HP Integrity Superdome SX1000 HP Insight Management WBEM Providers on Integrit - Page 28
Example 8-1 Displaying computer operational status information
View all HP Integrity Superdome SX1000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 28 highlights
Example 8-1 Displaying computer operational status information strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colComputerSystem = objWMIService.ExecQuery("Select * from HP_WinComputerSystem") For Each objComputerSystem in colComputerSystem WScript.Echo "Caption: " & objComputerSystem.Caption For Each objStatusDescription in objComputerSystem.StatusDescriptions WScript.Echo "Status description: " & objStatusDescription Next For Each objOperationalStatus in objComputerSystem.OperationalStatus WScript.Echo "Operational status: " & objOperationalStatus Next Next Example 8-2 Displaying the system firmware version strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colSystemROMFirmware = objWMIService.ExecQuery("Select * from HP_SystemROMFirmware") For Each objSystemROMFirmware in colSystemROMFirmware WScript.Echo "Caption: " & objSystemROMFirmware.Caption WScript.Echo "Version: " & objSystemROMFirmware.VersionString WScript.Echo Next Example 8-3 Displaying computer system chassis model name, serial number, and asset tag strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colComputerSystemChassis = objWMIService.ExecQuery("Select * from HP_ComputerSystemChassis") For Each objComputerSystemChassis in colComputerSystemChassis WScript.Echo "Model: " & objComputerSystemChassis.Model WScript.Echo "Serial number: " & objComputerSystemChassis.SerialNumber WScript.Echo "Asset tag: " & objComputerSystemChassis.UserTracking Next 28 Scripting examples