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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s