VMware Cloud Community
mmAsurion
Contributor
Contributor

PowerCLI question for ESXi 5.*

I'm trying to get the serial number of ESXi hosts. Get-View seems to be the only way to do it, but it only returns a serial number/service tag on 10% of my 700+ VMhosts. Is this a bug?


The server manufacturers are Cisco, IBM, and HP, but about 80% are Cisco UCS blades. What's weird is I may get a result with one Cisco UCS blade that is in the same Chassis with a blade that gets no result. I'm running mostly vCenter 5.0 with ESXi 5.0 build 804277.


Here's a script snippit:


Get-View -ViewType HostSystem -Property Name, Summary  | select name, { $_.Summary.Hardware.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq  "ServiceTag" } | % { $_.IdentifierValue } }

Reply
0 Kudos
2 Replies
kunaludapi
Expert
Expert

You can use esxcli.

$esxcli = get-vmhost Hostname  | Get-EsxCli

$esxcli.hardware.platform.get().SerialNumber

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
Reply
0 Kudos
mmAsurion
Contributor
Contributor

I get the same (or lack of) result with Get-EsxCli.

Reply
0 Kudos