Saturday, July 6, 2013

cmdBatch_WMIC_RemoteCPUEtc


cmdBatch_WMIC_RemoteCPUEtc.docx

WMIC.EXE is for windows local and remote info gathering and can be used in a cmd / DOS window


meta: wmi


See also C# usage on WMI Made Easy For C#. [ using System.Management; ] - This uses SQL like search criteria.


Example Testwmic.cmd:

@echo off
rem info on my local box that I am currently running the cmd in:
wmic  cpu get name, status, statusinfo, LoadPercentage, cpustatus, caption, maxclockspeed, systemname /format:textvaluelist.xsl
rem AboxTest03 info:
wmic /node:AboxTest03  cpu get name, status, statusinfo, LoadPercentage, cpustatus, caption, maxclockspeed, systemname /format:textvaluelist.xsl
rem AboxTest04 Info:
wmic /node: AboxTest04  cpu get name, status, statusinfo, LoadPercentage, cpustatus, caption, maxclockspeed, systemname /format:textvaluelist.xsl


Output:
C:\aaatest>Testwmic.cmd


Caption=x64 Family 6 Model 23 Stepping 7
CpuStatus=1
LoadPercentage=1
MaxClockSpeed=2667
Name=Intel(R) Core(TM)2 Quad  CPU   Q9450  @ 2.66GHz
Status=OK
StatusInfo=3
SystemName=MyLocalBoxName





Caption=Intel64 Family 6 Model 23 Stepping 10
CpuStatus=1
LoadPercentage=4
MaxClockSpeed=2333
Name=Intel(R) Xeon(R) CPU           E5410  @ 2.33GHz
Status=OK
StatusInfo=3
SystemName= AboxTest03





Caption=Intel64 Family 6 Model 23 Stepping 10
CpuStatus=1
LoadPercentage=0
MaxClockSpeed=2333
Name=Intel(R) Xeon(R) CPU           E5410  @ 2.33GHz
Status=OK
StatusInfo=3
SystemName= AboxTest04

Meanings of fields above:



CPUStatus
Data type: UInt16
Access type: Read-only
Qualifiers: None
Current status of the processor. Possible values are listed below. Status changes indicate processor usage, but not the physical condition of the processor.

0 (0x0)
Unknown
1 (0x1)
CPU Enabled
2 (0x2)
CPU Disabled by User via BIOS Setup
3 (0x3)
CPU Disabled by BIOS (POST Error)
4 (0x4)
CPU Is Idle
5 (0x5)
Reserved
6 (0x6)
Reserved
7 (0x7)
Other


LoadPercentage
Data type: UInt16
Access type: Read-only
Qualifiers: None
Load capacity for the processor, averaged to the last second. Processor loading refers to the total computing burden for a processor at one time.

MaxClockSpeed
Data type: UInt32
Access type: Read-only
Qualifiers: None
Maximum speed of the processor, in MHz.


Status
Data type: String
Access type: Read-only
Qualifiers: None
Current status of the processor. Possible values are:
·        OK
·        Error
·        Degraded
·        Unknown
·        Pred Fail
·        Starting
·        Stopping
·        Service
·        Stressed
·        NonRecover
·        NoContact
·        LostComm

StatusInfo
Data type: UInt16
Access type: Read-only
Qualifiers: None
State of the logical device. Possible values are listed below. If this property does not apply to the logical device, the property is set to "Not Applicable".

1 (0x1)
Other
2 (0x2)
Unknown
3 (0x3)
Enabled
4 (0x4)
Disabled
5 (0x5)
Not Applicable





No comments:

Post a Comment