archive:vmware_powercli
VMware PowerCLI
Get info on all VM's on all clusters with name, host and ip using PowerCLI
a few examples on how to get info on all VM's on all clusters with name, host and ip.
Get-Cluster * | Get-VM | Select Name, VMHost, @{N="IP Address";E={@($_.guest.IPAddress[0])}}
Get info on all VM's on all clusters with name, host, ip, running OS as well as real OS.
Get-Cluster * | Get-VM | Select Name, PowerState, VMHost, @{N="Configured OS";E={Get-VMGuest -VM $_}}, @{N="Real OS";E={$_.Guest.OsFullName}}, @{N="IP Address";E={@($_.guest.IPAddress[0])}} | Export-Csv filename.txt
Another example and exported as csv.
Get-VM | Sort | Get-View -Property @("Name", "Config.GuestFullName", "Guest.GuestFullName") | Select -Property Name, @{N="Configured OS";E={$_.Config.GuestFullName}}, @{N="Running OS";E={$_.Guest.GuestFullName}} | Format-Table -AutoSize | Export-Csv filename.csv
List all VM's on a specific cluster
Get-Cluster "CLUSTER NAME" | Get-VM | Sort Name
archive/vmware_powercli.txt · Last modified: 24/11/2023 12:45 by Allan