VMware Cloud Community
virtualdive
VMware Employee
VMware Employee
Jump to solution

To get the BIOS and Firmware info. from PowerCLI

Hi All,

Can anyone please share a PowerCLI script to get the below information on all the hosts in vCenter?

1. BIOS Version

2. BIOS Date

3. Firmware Version

4. Firmware Date

I have this but it only shows for one server and only BIOS details. I want for all the hosts in the vCenter.

$VMHost = Get-VMHost 'Server01' | Get-View
$VMHost.Hardware.BiosInfo

Thank you

Nick

Regards,

'V'
thevshish.blogspot.in
vExpert-2014-2021
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

To run this for multiple ESX(i) servers you can do

Get-View -ViewType HostSystem | Select Name,@{N="BIOS version";E={$_.Hardware.BiosInfo.BiosVersion}},   
   @{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}}

Note that the presence of these values depends on the HW you are using.

There are several HW types from different vendors that do not populate these values correctly.

Not sure what you mean with the firmware properties.

Are these displayed in the vSphere Client ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

To run this for multiple ESX(i) servers you can do

Get-View -ViewType HostSystem | Select Name,@{N="BIOS version";E={$_.Hardware.BiosInfo.BiosVersion}},   
   @{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}}

Note that the presence of these values depends on the HW you are using.

There are several HW types from different vendors that do not populate these values correctly.

Not sure what you mean with the firmware properties.

Are these displayed in the vSphere Client ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
virtualdive
VMware Employee
VMware Employee
Jump to solution

Bam! Cheers Luc........I recieved your Book Automating vSphere Administration yesterday. That is awsome piece of work, really helpful and recommended to all who wants to get started or play with PowerCLI.

Nick...

Regards,

'V'
thevshish.blogspot.in
vExpert-2014-2021
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Thanks Nic, I hope you will find many useful ideas in the book.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
virtualdive
VMware Employee
VMware Employee
Jump to solution

Hey Luc,

Just a quick one, the script you sent ran successfully on the HP Blades but this isn't working on the Dell PowerEdge 900 servers. Am I missing something?

thanks

Regards,

'V'
thevshish.blogspot.in
vExpert-2014-2021
Reply
0 Kudos
brwuchner
Contributor
Contributor
Jump to solution

Luc,

I'm a big fan of your work.  I had an idea on using this code to verify that all hosts in a cluster had the same BIOS version.  I'm running into a slight problem though, and wanted to see if you could help.  I have two 8 node clusters made up of identical hardware.  When running this code against those 16 boxes in vCenter, only 3 of them return Bios Version info.  However, if I connect to each host directly the Bios Version is available.  Also, when looking at the 'Hardware Status' tab all hosts are reporting the same version.  Any ideas on how I could troubleshoot this?

Thanks,

Brian

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Strange, I have no immediate explanation for the behaviour you are seeing.

Can you perhaps include the script you are using ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
AureusStone
Expert
Expert
Jump to solution

I have seen this bug before, but I am not aware of any resolution.  I think it is probably a vSphere bug and not the hardware vendors fault.

Just using the HostSystem object from the api has the same issue.  The host is reporting all of the information correctly via IPMI.

Not really helpful, but I would like to know the reason also. Smiley Happy

Reply
0 Kudos
brwuchner
Contributor
Contributor
Jump to solution

I was using the code provided above:

Get-View -ViewType HostSystem | Select Name,@{N="BIOS version";E={$_.Hardware.BiosInfo.BiosVersion}},    
   @{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}}

It worked fine if I would connect-viserver to the individual ESXi hosts, but when pointing at vCenter it only worked for 3 of 16 hosts.  After a little bit of Googling, I think I found someone else who has encountered this problem -- http://www.sandfordit.com/vwiki/index.php?title=VI_Toolkit_(PowerShell)

That page has a "ESX Inventory Getter" script that checks for the Hardware.BiosInfo value and uses it if available.  However, it will fail to a section that parses the Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo information if needed. I switched to just the Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo section and can now get the BIOS values for all 16 hosts.  The code isn't as clean as what you provided, but appears to work on all my hosts:

$report = @()
Get-View -ViewType HostSystem | %{ 
     $row = "" |Select Name, "BIOS Version", "BIOS Date"
     $row.name = $_.name
     $biosTemp = ((($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo | Where {$_.Name -like "*BIOS*"}).Name -split "BIOS ")[1] -split " ")
     $row."BIOS Version" = $biosTemp[0]
     $row."BIOS Date" = $biosTemp[1]
     $report += $row
}
$report
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Like it is also mentioned in that Wiki, this depends on the CIM provider from the HW vendor.

While it will work on HP HW, this will probably not work on other vendor's HW.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
brwuchner
Contributor
Contributor
Jump to solution

Yeah, I'm not a big fan of anything that requires splitting on text and assuming that the order will be consistent.  I have tested the code on 2 HP servers, ~40 Dell servers and 2 nested ESXi VMs and appear to be getting expected results cross vendor - at least for now.

Reply
0 Kudos