SCVMM Script Snip

Logo_PowerShell_2

I have been answering some questions in the Hyper-V forums and a post got me thinking about how to change the startup  delay for masses of VMs managed by SCVMM and then targeting other VMs with different settings.  Thought I would share them here.

# This sets the all VMs on host(s) to delay start 120

$VM = get-vm | ? {$_.hostname -like "Servername*"}

$VM | set-vm –delaystart 120

 

# This sets specific VMs on host(s) to delay start 5

$VM1 = get-vm | ? {$_.hostname -like "Servername*"}  | ? {$_.name -like "DC*" -or $_.name -like "EX*" -or $_.name -like "*SQL*"}

$VM1 | set-vm -delaystart 5

 

Quick and dirty, and the syntax could be modified with most any other attributes to change VM properties very quickly.

Follow the Hyper-V Forum thread here.

Rob

Advertisements
This entry was posted in Hyper-V, SCVMM. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s