I'd like to list all vm to a single row ,which are running on each ESXi host independent of vm state. I thought to this script but I don't know how to continue: foreach ($cluster in Get-Clust...
See more...
I'd like to list all vm to a single row ,which are running on each ESXi host independent of vm state. I thought to this script but I don't know how to continue: foreach ($cluster in Get-Cluster) { write-host "`nCluster: " $cluster foreach ($esxhost in Get-Cluster $cluster | Get-VMHost) { write-host " Host: " $esxhost .... } } e.g. Cluster: A Host: host1 vm: vmA, vmB, vmC, vmD, ... Host: host2 vm: vmA1, vmB1, vmC1, vmD1, ... Host: host3 vm: vmA2, vmB2, vmC2, vmD2, ... Cluster: B Host: host3 vm: vmAA, vmBB, vmCC, vmDD, ... Host: host4 vm: vmAA1, vmBB1, vmCC1, vmDD1, ... If I wanted to write this output to Excel file? Thanks