Hardware.SystemInfo.OtherIdentifyingInfo Blank in PowerCLI
Summary:
Using my PowerCLI script to get Dell warranty information, I noticed that some of my ESX hosts were not returning service/asset tag information. The information was showing up in vCenter's hardware status tab, but not w/ my PowerCLI script.
Workaround:
Using my PowerCLI script to get Dell warranty information, I noticed that some of my ESX hosts were not returning service/asset tag information. The information was showing up in vCenter's hardware status tab, but not w/ my PowerCLI script.
Workaround:
- First, check to see if your ESX host has this information populated:
- If the above code returns objects, then the next step is to disconnect the host from vCenter, then reconnect it. You can use the following PowerCLI code to find all hosts w/ empty properties to do this for you. As always, test before you try it in a production environment.
- Now running the code in my Dell Warranty Script should have all information populated as long as the ESX host has the information.
Connect-viServer ESXHostName
$VMHost = Get-VMHost | Get-View
$VMHost.Hardware.SystemInfo.OtherIdentifyingInfo
$ESXHosts = @()
$VMHosts = Get-VMHost | Get-View
Foreach ($VMHost in $VMHosts)
{
$NewObj = "" | Select Name, ServiceTag, AssetTag
$NewObj.Name = $VMHost.Name
#Replace is used to clean up data that might be there for easier filtering
$NewObj.ServiceTag = ($VMHost.hardware.systeminfo.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq "servicetag"}).identifierValue -replace(" ","")
$NewObj.AssetTag = ($VMHost.hardware.systeminfo.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq "assettag"}).identifierValue -replace(" ","")
$ESXHosts += $NewObj
}
$VMHostsFiltered = $ESXHosts | Where-Object {($_.ServiceTag -eq "" -or $_.AssetTag -eq "") -and ($_.ServiceTag -ne "unknown") -and ($_.AssetTag -ne "unknown")}
Foreach ($EvilESXBox in $VMHostsFiltered)
{
Set-VMHost -VMHost $EvilESXBox.Name -State Disconnected
Set-VMHost -VMHost $EvilESXBox.Name -State Connected
}
FYI:
If the assettag and servicetag fields are blank or unknown, it's likely that your server needs to be flashed by a Dell Technician to insert the service tag info. It supposed to be pre-populated by the factory, but if you've had the motherboard replaced, then it needs to be flashed.
Comments