Saturday, February 11, 2023

Here is a handy bit of PowerCLI to return the VMhost Name, Product, ESXi build, Serial number of all hosts in vCenter.

 

Run below syntax on powercli to get the VMhost Name, Product, ESXi build, Serial number of all hosts in vCenter.



Get-Vmhost | Get-View | Sort-object Name |
select Name,
@{N='Product';E={$_.Config.Product.FullName}},
@{N='Build';E={$_.Config.Product.Build}},
@{Name="Serial Number"; Expression={($_.Hardware.SystemInfo.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq "ServiceTag"}).IdentifierValue}}




OR


Get-VMHost | Get-View | Select Name, @{l=”SerialNumber”; e={$_.Hardware.SystemInfo.OtherIdentifyingInfo.IdentifierValue.split(“,”)[0]}}

2 comments:

ESXI-check multiple ports using one command

  [root@ESXI:~] nc -w 1 -z IP 80-902 Connection to IP 80 port [tcp/http] succeeded! Connection to IP 88 port [tcp/kerberos] succeeded! Conne...