PowerShell: Change Automatic Start Action on Hyper-V VM`s

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
VN:F [1.9.22_1171]
Rating: 0.0/6 (0 votes cast)

2 thoughts on “PowerShell: Change Automatic Start Action on Hyper-V VM`s”

  1. 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.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    1. Hello, Is the VM machines running? becourse the command only returns VMs there is currently running.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)

Leave a Reply

Your email address will not be published. Required fields are marked *