rafvasq
rafvasq

Reputation: 1510

List VMs and their cluster

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?

Upvotes: 6

Views: 21486

Answers (2)

Dominik
Dominik

Reputation: 125

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

Get-Cluster | Get-VM

Upvotes: 0

DAXaholic
DAXaholic

Reputation: 35408

Try that

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

which I found here

Upvotes: 6

Related Questions