Thursday, December 15, 2011

Assign a cloud with PowerShell

A question was raised in the VMM forum earlier.
The user wanted to assign a cloud for a bunch of VMs, and that would be a very long and manual process to do without using PowerShell.

In Norway, we have a PowerShell MVP – Jan Egil Ring, and I asked him to answer this thread using his skills J

Here`s the PowerShell cmdlets for assigning a cloud for your VMs.

$cloud = Get-SCCloud -Name "Cloud 01"

Get-VM | Where-Object {-not $_.cloud} | Set-VM -Cloud $cloud

No comments: