As users of System Center Virtual Machine Manager would know, trying to quickly live migrate multiple VM’s can be a slow and tedious task.

Whilst I always recommend to user of VMM to use the Migrate Virtual Machine function or the Start Maintenance Mode options, sometimes I need to react quickly and the normal VMM way isn’t fast enough. This is where PowerShell comes in…

$VMS = Get-SCVirtualMachine | ogv -passthru
$VMHost = Get-SCVMHost | ogv -passthru
ForEach ($VM in $VMS)
 {
 Move-SCVirtualMachine -VM $VM -VMHost $VMHost -HighlyAvailable $true -RunAsynchronously -UseDiffDiskOptimization
 }

Hope this helps! Dan

Daniel Apps

Hi, I'm Daniel Apps — AI platform enthusiast, unapologetic infrastructure nerd, and dad to two small humans. I write about infrastructure, AI industry topics, and the real-world chaos of modern IT.

More about me →

s