VBScript using WMI to show temperature probe and fan information
----Begin VBScript----
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_TemperatureProbe",,48)
'Loop through the collection
For Each objItem in colItems
'Echo out the properties for each item
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Availability: " & objItem.Availability
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "CurrentReading: " & objItem.CurrentReading & " Tenths of a Degree C"
Wscript.Echo "Status: " & objItem.Status & vbCrLf
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_Fan",,48)
'Loop through the collection
For Each objItem in colItems
'Echo out the properties for each item
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Availability: " & objItem.Availability
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Status: " & objItem.Status & vbCrLf
Next
----End VBScript----
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_TemperatureProbe",,48)
'Loop through the collection
For Each objItem in colItems
'Echo out the properties for each item
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Availability: " & objItem.Availability
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "CurrentReading: " & objItem.CurrentReading & " Tenths of a Degree C"
Wscript.Echo "Status: " & objItem.Status & vbCrLf
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_Fan",,48)
'Loop through the collection
For Each objItem in colItems
'Echo out the properties for each item
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Availability: " & objItem.Availability
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Status: " & objItem.Status & vbCrLf
Next
----End VBScript----
Comments