With PowerCLI, you can get information about all available hosts in a datacenter and view their properties.

Connect to a vSphere server.

1

Get a list of all hosts that are part of a datacenter.

Get-Datacenter DC | Get-VMHost | Format-Custom
2

View the properties of the first host in the datacenter.

Get-Datacenter DC | Get-VMHost | Select-Object -First 1 | Format-Custom
3

View the Name and the OverallStatus properties of the hosts in the DC datacenter.

Get-Datacenter DC | Get-VMHost | Get-View | Format-Table -Property Name, OverallStatus -AutoSize
4

View all hosts and their properties, and save the results to a file.

Get-Datacenter DC | Get-VMHost | Format-Custom | Out-File –FilePath hosts.txt
5

View a list of the hosts that are in maintenance mode and can be configured for vMotion operations.

Get-VMHost -State maintenance | Get-View | Where-Object -FilterScript { $_.capability -ne $null -and $_.capability.vmotionSupported }