List VMs and their cluster

rafvasq picture rafvasq · Sep 4, 2016 · Viewed 8k times · Source

I'd like to be connected to multiple VIservers and list all the VMs + their respective clusters. Is this possible?

I've gotten as far as Get-VM | Select Name,VMHost. What property in place of VMHost would list the cluster?

Answer

DAXaholic picture DAXaholic · Sep 4, 2016

Try that

Get-VM | Select-Object -Property Name,@{Name=’Cluster’;Expression={$_.VMHost.Parent}}

which I found here