6

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?

DAXaholic
  • 33,312
  • 6
  • 76
  • 74
rafvasq
  • 1,512
  • 3
  • 18
  • 48

2 Answers2

6

Try that

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

which I found here

DAXaholic
  • 33,312
  • 6
  • 76
  • 74
0

Depending of your use case you could also get the VMs if you know the cluster:

Get-Cluster | Get-VM
Dominik
  • 125
  • 1
  • 1
  • 6