PowerTip: Use PowerShell to Find Running Virtual Machines

Summary: Sean Kearney explains how to use Windows PowerShell to find running virtual machines.

Hey, Scripting Guy! Question How can I find a list of virtual machines on my computer that is running Windows Server 2012 with Hyper-V?

Hey, Scripting Guy! Answer Use the Get-VM cmdlet and filter on the State property:

Get-VM | Where { $_.State -eq 'Running' }

Or if you need to check a remote computer:

Get-VM -computername RemoteHyperVServer | Where { $_.State -eq 'Running' }\

Comments (2)

  1. Karthick kesavan says:

    post is good !!!

  2. Matha says:

    How to extend this example to start a vm if it is NOT running? Sequence of "starts" is unimportant for the inquiry. 🙂 TIA.

Skip to main content