Quick vSphere Cluster BIOS check

The following check will compare the BIOS versions of the ESX hosts in a cluster and verify they are all at a consistent level.

The check makes use of a $Clusters variable, which can be created using the following line of code:

$clusters = Get-Cluster

This check will look for inconsistent BIOS versions between hosts in a vSphere cluster.
[cc lang=”powershell”]
$misMatchBios = @()
$Clusters | select Name, ID | %{
$thisClusterName = $_.Name
$thisClusterBIOS = Get-View -ViewType HostSystem -SearchRoot $_.id -Property Name, “Hardware.BiosInfo” | Select Name,@{N=”Cluster Name”;E={$thisClusterName}},@{N=”BIOS version”;E={$_.Hardware.BiosInfo.BiosVersion}}, @{N=”BIOS date”;E={$_.Hardware.BiosInfo.releaseDate}}
$thisClusterBiosGroup = $thisClusterBIOS | Group-Object -Property “BIOS Version”

if ( ($thisClusterBiosGroup | Measure-Object).Count -gt 1 ) { $misMatchBios += ( $thisClusterBIOS | Sort Name ) }
}
$misMatchBios
[/cc]

This entry was posted in Scripting, Virtualization. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.