The advantage of below powerCLI is that oneliner shows as well SerialNumber (for example Dell/HP tags – very useful to find your esxi server in Datacenter physically )
Get-VMHost |Select-Object Name,NetworkInfo,Manufacturer,Model,ProcessorType, ConnectionState, PowerState, NumCpu, MemoryTotalGB, Version, Build, MaxEVCMode, @{N="SerialNumber";E={(Get-VMHostHardware -vmhost $_).SerialNumber}} | Export-Csv -notypeinformation -Path c:\temp\all-vmhosts.csv
or more detailed report:
.'C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1'
connect-viserver vcsa.itforce.local
function Get-VMHostWSManInstance {
param (
[Parameter(Mandatory=$TRUE,HelpMessage="VMHosts to probe")]
[VMware.VimAutomation.Client20.VMHostImpl[]]
$VMHosts,
[Parameter(Mandatory=$TRUE,HelpMessage="Class Name")]
[string]
$class,
[switch]
$ignoreCertFailures,
[System.Management.Automation.PSCredential]
$credential=$null
)
$omcBase = "http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/"
$dmtfBase = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/"
$vmwareBase = "http://schemas.vmware.com/wbem/wscim/1/cim-schema/2/"
if ($ignoreCertFailures) {
$option = New-WSManSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
} else {
$option = New-WSManSessionOption
}
foreach
…
Read the rest