To easy change Automatic Start Action on all runnings VM´s on your Hyper-V server run this command:
Get-VM | Where { $_.State –eq ‘Running’ } | Set-VM -AutomaticStartAction StartIfRunning
To validate it run this command:
Get-VM | Where { $_.State –eq ‘Running’ } | ft Name, AutomaticStartAction -AutoSize
Hello. When run the command it doesnt seem to do anything. Ive manually set one of the VMs automaticstartaction to Nothing, but it doesnt change with this script.
Im running it in Powershell ISE as admin on the HV.
Hello, Is the VM machines running? becourse the command only returns VMs there is currently running.