Hi
I've a maintenance is coming up for which I need to shutdown 1000+ VMs and once the Maintenance is complete, Need to start those VMs back on.
I've a list of 1000 VMs and I can run in for loop but that will take hours to shutdown these VMs and I only have 2 hours of Maintenance window, Can someone please help ?
Here is the script which I got from the community and it works as expected but it runs serially.
foreach ($vmlist in (Get-Content -Path C:\vmlist1.txt)){
$vm = Get-VM -Name $vmlist
Start-VM -VM $vm -Confirm:$false -RunAsync
}
Thanks & Regards