HP DL360 HP Insight Management WBEM Providers for Windows Server 2003 and Wind - Page 30

Set colFan = objWMIService.ExecQuerySelect * from HP_WinFan

Page 30 highlights

This VBScript code is used to list system memory modules and their capacities: strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colMemoryModule = objWMIService.ExecQuery("Select * from HP_MemoryModule") For Each objMemoryModule in colMemoryModule WScript.Echo "Caption: " & objMemoryModule.Caption WScript.Echo "Capacity (bytes): " & objMemoryModule.Capacity Wscript.Echo Next This VBScript code is used to list system processors, current clock speed, and the number of enabled cores: strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colProcessor = objWMIService.ExecQuery("Select * from HP_Processor") For Each objProcessor in colProcessor WScript.Echo "Caption: " & objProcessor.Caption WScript.Echo "Description: " & objProcessor.Description WScript.Echo "Current clock speed (MHz): " & objProcessor.CurrentClockSpeed WScript.Echo "Number of enabled cores: " & objProcessor.NumberOfEnabledCores Wscript.Echo Next This VBScript code is used to list fans and operational status information: strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colFan = objWMIService.ExecQuery("Select * from HP_WinFan") For Each objFan in colFan WScript.Echo "Caption: " & objFan.Caption WScript.Echo "Description: " & objFan.Description For Each objStatusDescription in objFan.StatusDescriptions WScript.Echo "Status description: " & objStatusDescription Next For Each objOperationalStatus in objFan.OperationalStatus Insight Providers architecture 30

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41

Insight Providers architecture 30
This VBScript code is used to list system memory modules and their capacities:
strComputer = "."
strNamespace = "\root\hpq"
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
strNamespace)
Set colMemoryModule = objWMIService.ExecQuery("Select * from
HP_MemoryModule")
For Each objMemoryModule in colMemoryModule
WScript.Echo "Caption: " & objMemoryModule.Caption
WScript.Echo "Capacity (bytes): " & objMemoryModule.Capacity
Wscript.Echo
Next
This VBScript code is used to list system processors, current clock speed, and the number of enabled
cores:
strComputer = "."
strNamespace = "\root\hpq"
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
strNamespace)
Set colProcessor = objWMIService.ExecQuery("Select * from HP_Processor")
For Each objProcessor in colProcessor
WScript.Echo "Caption: " & objProcessor.Caption
WScript.Echo "Description: " & objProcessor.Description
WScript.Echo "Current clock speed (MHz): " &
objProcessor.CurrentClockSpeed
WScript.Echo "Number of enabled cores: " &
objProcessor.NumberOfEnabledCores
Wscript.Echo
Next
This VBScript code is used to list fans and operational status information:
strComputer = "."
strNamespace = "\root\hpq"
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
strNamespace)
Set colFan = objWMIService.ExecQuery("Select * from HP_WinFan")
For Each objFan in colFan
WScript.Echo "Caption: " & objFan.Caption
WScript.Echo "Description: " & objFan.Description
For Each objStatusDescription in objFan.StatusDescriptions
WScript.Echo "Status description: " & objStatusDescription
Next
For Each objOperationalStatus in objFan.OperationalStatus