The Win32 providers (called WINCIM32 and WINCIM32a) are certainly the WMI providers supporting the biggest number of classes among all providers that come with WMI. All the Win32 provider classes are available in the Root\CIMv2 namespace.
The Win32 providers are implemented as instance and method providers. They are not implemented as event providers, which means that the use of the WITHIN statement in the context of a WQL event query is required. They support Get, Put, Enumerations, and Delete operations. This means that it is possible to retrieve a single instance (get) with a WMI object path, modify a single instance (put), retrieve instances by enumeration, and delete instances (see Table 2.1). All these operations are also influenced by the class capabilities.
Provider Name | Provider Namespace | Class Provider | Instance Provider | Method Provider | Property Provider | Event Provider | Event consumer Provider | Support Get | Support Put | Support Enumeration | Support Delete | Windows Server 2003 | Windows XP | Windows 2000 Server | Windows 2000 Professional | Windows NT 4.0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Win32 Providers | ||||||||||||||||
CIMWin32 | Root/CIMV2 | X | X | X | X | X | X | X | X | X | X | X | ||||
Cimwin32A | Root/CIMV2 | X | X | X | X | X | X | X | X |
The Win32 provider classes are classified in two large categories: the "Computer System Hardware Classes" and "Operating System Classes."
The Win32_Service class used throughout the first book, Understanding WMI Scripting, is a class supported by the Win32 providers. All classes supported by the Win32 providers can be used in the same way as the Win32_Service class. Of course, the script must respect the properties and the methods exposed by the classes, but the scripting technique is exactly the same.
Once again, we cannot examine in detail all classes supported by the Win32 providers. This would be a repeat of the information already available in the Platform SDK and the MSDN Library. However, it is highly recommended to explore the class instances with Sample 1.4 ("Listing a single instance of a class with its properties formatted") and Sample 1.5 ("Listing all instances of a class with their properties formatted") developed in the previous chapter. The class characteristics can be discovered with the LoadCIMInXL.wsf script previously developed (see Sample 4.32 in the appendix). All properties and methods exposed by the classes are retrieved with this script. By using the LoadCIMInXL.wsf script, even the classes not documented in the Microsoft Platform SDK are self-documented. Of course, you can also use the WMI CIM Studio as a discovery tool.
In the next sections, we examine, by category, some of the most interesting classes available from the Win32 providers and how to use them in scripts directly applicable in the field.