{"id":639,"date":"2011-08-09T16:26:17","date_gmt":"2011-08-09T20:26:17","guid":{"rendered":"http:\/\/enterpriseadmins.org\/blog\/?p=639"},"modified":"2011-08-09T16:26:17","modified_gmt":"2011-08-09T20:26:17","slug":"using-powercli-to-find-esxesxi-bios-versions","status":"publish","type":"post","link":"https:\/\/enterpriseadmins.org\/blog\/scripting\/using-powercli-to-find-esxesxi-bios-versions\/","title":{"rendered":"Using PowerCLI to find ESX\/ESXi BIOS Versions"},"content":{"rendered":"<p>A few weeks ago I updated the BIOS on several Dell R810 servers running ESXi 4.1U1.  After applying the update I disabled the C-States and C1E settings as described here: <a href=\"http:\/\/enterpriseadmins.org\/blog\/virtualization\/vmware-esxi-psod-on-dell-server\/\">http:\/\/enterpriseadmins.org\/blog\/virtualization\/vmware-esxi-psod-on-dell-server\/<\/a>.  Once I had all my updates completed, I wanted to validate that each host was reporting the latest BIOS version.  A quick search of the PowerCLI forums turned up this article where @LucD had already provided the required code <a href=\"http:\/\/communities.vmware.com\/message\/1785476\">http:\/\/communities.vmware.com\/message\/1785476<\/a><\/p>\n<pre>\r\nGet-View -ViewType HostSystem | Select Name,@{N=\"BIOS version\";E={$_.Hardware.BiosInfo.BiosVersion}},    \r\n   @{N=\"BIOS date\";E={$_.Hardware.BiosInfo.releaseDate}}\r\n<\/pre>\n<p>I ran into problems where only 3 of 16 hosts reported any BIOS Version.  A little more searching, and I found some code that looks like someone else had encountered the same issue: <a href=\"http:\/\/www.sandfordit.com\/vwiki\/index.php?title=VI_Toolkit_(PowerShell)\">http:\/\/www.sandfordit.com\/vwiki\/index.php?title=VI_Toolkit_(PowerShell)<\/a>.  In the referenced WIKI article, the author checked the Hardware.BiosInfo, and if it wasn&#8217;t available they parsed Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo.  This second method worked on all 16 of 16 hosts I was interested in (sample code below):<\/p>\n<pre>\r\n$report = @()\r\nGet-View -ViewType HostSystem | %{ \r\n     $row = \"\" |Select Name, \"BIOS Version\", \"BIOS Date\"\r\n     $row.name = $_.name\r\n     $biosTemp = ((($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo | Where {$_.Name -like \"*BIOS*\"}).Name -split \"BIOS \")[1] -split \" \")\r\n     $row.\"BIOS Version\" = $biosTemp[0]\r\n     $row.\"BIOS Date\" = $biosTemp[1]\r\n     $report += $row\r\n}\r\n$report\r\n<\/pre>\n<p>This code block is on the road map for a future release of vCheck.  I&#8217;m actually planning to only show clusters that contain hosts with different BIOS versions; if the cluster is good there shouldn&#8217;t be a reason to report on the issue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few weeks ago I updated the BIOS on several Dell R810 servers running ESXi 4.1U1. After applying the update I disabled the C-States and C1E settings as described here: http:\/\/enterpriseadmins.org\/blog\/virtualization\/vmware-esxi-psod-on-dell-server\/. Once I had all my updates completed, I wanted &hellip; <a href=\"https:\/\/enterpriseadmins.org\/blog\/scripting\/using-powercli-to-find-esxesxi-bios-versions\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-639","post","type-post","status-publish","format-standard","hentry","category-scripting","category-virtualization"],"_links":{"self":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/comments?post=639"}],"version-history":[{"count":5,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/639\/revisions"}],"predecessor-version":[{"id":645,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/639\/revisions\/645"}],"wp:attachment":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/media?parent=639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/categories?post=639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/tags?post=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}