Greetings,
I need Powercli script to list cluster Name, Guest and ESXi Hostnames in Cluster, then export to a csv file
Thanks
I asume that you want the cluster name, guest and hostname for all your vm's. You can this information and export it to a .csv file as follows:
Get-VM | Select-Object -Property @{N="VM";E={$_.Name}}, VMHost, @{N="Cluster";E={$_.VMHost.Parent.Name}}, @{N="Guest";E={$_.Guest.OSFullName}} | Export-Csv -Path VMInfo.csv -NoTypeInformation -UseCulture
I asume that you want the cluster name, guest and hostname for all your vm's. You can this information and export it to a .csv file as follows:
Get-VM | Select-Object -Property @{N="VM";E={$_.Name}}, VMHost, @{N="Cluster";E={$_.VMHost.Parent.Name}}, @{N="Guest";E={$_.Guest.OSFullName}} | Export-Csv -Path VMInfo.csv -NoTypeInformation -UseCulture