WMI: 非主流Query Namespaces

  • The great thing about WMI is that it provides metadata about itself. Maclin provides this example of WSH VBScript code to recursively enumerate namespaces: The namespaces are:

 

root/SECURITY
root/SecurityCenter
root/WMI
root/WMI/ms_409
root/CIMV2
root/CIMV2/ms_409
root/CIMV2/Applications
root/CIMV2/Applications/MicrosoftACT
root/CIMV2/Applications/MicrosoftIE
root/Microsoft
root/Microsoft/HomeNet
root/DEFAULT
root/DEFAULT/ms_409
root/directory
root/directory/LDAP
root/directory/LDAP/ms_409
root/subscription
root/subscription/ms_409
root/MSAPPS11

Example:

 

 wbemdump /Q root\cimv2 WQL "select Manufacturer from Win32_SystemEnclosure

This returns a number (such as "6").

Some applications provide an English translation, such as a datamap.ini that contains:

 

[INV_List_ChassisTypes]
0 = Unknown
1 = Other
2 = Unknown
3 = Desktop
4 = Low Profile Desktop
5 = Pizza Box
6 = Mini Tower
7 = Tower
8 = Portable etc.
9 = Laptop
10 = Notebook
11 = Hand Held
12 = Docking Station
13 = All in One
14 = Sub Notebook
15 = Space-Saving
16 = Lunch Box
17 = Main System Chassis
18 = Expansion Chassis
19 = SubChassis
20 = Bus Expansion Chassis
21 = Peripheral Chassis
22 = Storage Chassis
23 = Rack Mount Chassis
24 = Sealed-Case PC

Every WMI class has a "Caption" property — a short description of the object-a one-line string.

WSH query to a remote computer can be defined using the winmgmts: object:

 

Set objWMIService = GetObject("winmgmts://Computer_B\root\cimv2)

The .NET sample application "Processes and Services Explorer" PsView.exe is installed by running the .NET nmake (from the VS.NET Bin folder) while in Program Files\Microsoft Visual Studio .NET 2003 folderSDK\v1.1\Samples\Technologies\Interop\Applications\WMI

The installation depends on the WBEMSCRIPTING.dll which is also used by HealthMonitor, a free Windows Serviceanother page on this site app developed Vitorio Parvesi with VB.NET and WMI to check Windows system status (event viewer, disk free space, services status, performance, etc....)

The C# source for the program is in subfolder Form

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值