RSS

Using WMI to query HP blade Enclosure information

28 May

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
Advertisements
 
Leave a comment

Posted by on May 28, 2012 in Scripts, VBScripts

 

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: