RSS

Tag Archives: wmi

Using WMI to query HP blade Enclosure information

Recently, we had some issues with HP cSeries blade enclosures which requires me to gather the firmware information of the enclosure, blade iLO and blade ROM.

Using WMIExplorer I found that the WMI information is kept in the root\HPQ and got a quick and dirty script to query the information I need.

set objArg = WScript.Arguments
if objArg.Count >= 1 then
strComputer = objArg(0)
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\HPQ")
Set colItems = objWMIService.ExecQuery _
    ("Select * from HP_BladeEnclosureCS")
For Each objItem in colItems
    Encl_Name = objItem.Name
    Encl_IP = objItem.ManagementIPAddress
    exit for
Next
Set colItems = objWMIService.ExecQuery _
    ("select * from HP_BladeEnclosureFW")
For Each objItem in colItems
    Encl_FW = objItem.VersionString
    exit for
Next
Set colItems = objWMIService.ExecQuery _
    ("select * from HP_SystemROMFirmware")
For Each objItem in colItems
    If InStr(objItem.Caption, "Active") > 0 then
      Blade_FW = objItem.VersionString
    end if 
    exit for
Next
Set colItems = objWMIService.ExecQuery _
    ("select * from HP_MPFirmware")
For Each objItem in colItems
    Blade_iLO_FW = objItem.VersionString
    exit for
Next
Wscript.echo strcomputer & vbTab & Blade_FW & vbTab & Blade_iLO_FW _
  & vbTab & Encl_Name & vbTab & Encl_Ip & vbTab & Encl_FW
end if
 
Leave a comment

Posted by on May 28, 2012 in Scripts, VBScripts

 

Tags: ,