Tag Archives: Get-VM

How many VM’s are running in Hyper-V cluster?

Common question asked by many admins, How many virtual machines are running in my Hyper-V cluster? This quick one line powershell cmd queries the cluster object for all VM’s and gathers some key usage configuration information and exports to CSV for easy reading.

Run this command on any Hyper-V node in the cluster. Tested on Microsoft Windows Server 2012 R2

Get-ClusterGroup | ? {$_.GroupType -eq 'VirtualMachine' } | Get-VM | ft VMName, State, ProcessorCount,@{label="MemoryStartup(GB)";Expression={$_.MemoryStartup/1024/1024}},DynamicMemoryEnabled |out-file C:\hvlist.csv