Tag Archives: powercli

PowerCLI: Checking for and removing Virtual Machine Memory Limits

Here is a quick one liner I found to check for any VMs which had memory limits set on them:

Get-VM | Get-VMResourceConfiguration | where {$_.MemlimitMB -ne -1}

If you want to target a specific cluster, just add Get-Cluster “clustername” to the beginning:

Get-Cluster “Clustername” | Get-VM | Get-VMResourceConfiguration | where {$_.MemlimitMB -ne -1}

Now if you want to get rid of the memory limits, add the following:

Set-VMResourceConfiguration -MemlimitMB $null

Final script for all VMs to find and remove limits:

Get-VM | Get-VMResourceConfiguration | where {$_.MemlimitMB -ne -1} | Set-VMResourceConfiguration -MemlimitMB $null

Next step…setting this as a scheduled workflow in Orchestrator to run every night/week and send a report out of any limits discovered.

*Note: This is a repost due to move from Systemsgame.com to 2ninjas1blog.com*

PowerCLI: List of VMWare Hosts, Clusters, Datacenters


Fatal error: Uncaught Error: Call to undefined function create_function() in /home2/ninjasbl/public_html/wp-content/plugins/wp-spamshield/wp-spamshield.php:2033 Stack trace: #0 /home2/ninjasbl/public_html/wp-includes/class-wp-hook.php(303): rs_wpss_encode_emails('<p>Just a quick...') #1 /home2/ninjasbl/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters('<p>Just a quick...', Array) #2 /home2/ninjasbl/public_html/wp-includes/post-template.php(253): apply_filters('the_content', 'Just a quick on...') #3 /home2/ninjasbl/public_html/wp-content/themes/suits/content.php(33): the_content('Continue readin...') #4 /home2/ninjasbl/public_html/wp-includes/template.php(772): require('/home2/ninjasbl...') #5 /home2/ninjasbl/public_html/wp-includes/template.php(716): load_template('/home2/ninjasbl...', false, Array) #6 /home2/ninjasbl/public_html/wp-includes/general-template.php(204): locate_template(Array, true, false, Array) #7 /home2/ninjasbl/public_html/wp-content/themes/suits/archive.php(67): get_template_part('content', '') #8 /home2/ninjasbl/public_html/wp-includes/template-loader.php(106): include('/home2/ninjasbl...') #9 /home2/ninjasbl/public_html/wp-blog-header.php(19): require_once('/home2/ninjasbl...') #10 /home2/ninjasbl/public_html/index.php(17): require('/home2/ninjasbl...') #11 {main} thrown in /home2/ninjasbl/public_html/wp-content/plugins/wp-spamshield/wp-spamshield.php on line 2033