You can use WMI from client applications and scripts. It provides an infrastructure that makes it easy to both discover and perform management tasks. In addition, you can add to the set of possible management tasks by creating your own WMI providers.
The following topics are discussed in this section:
Obtaining Data from WMI
The following procedure describes how to obtain data from WMI by writing a script or application.
To obtain data from WMI by writing a script or application
- Decide which language to use. For more information about scripting, see
Creating a WMI Script.
For more information about C++, see Creating a WMI Application Using C++. For using more information about C# or WMI .NET, see WMI .NET Overview.
You can view or manipulate WMI data in many languages. The following table lists the topics that describe how to use the scripting and application languages to obtain data.
- Ensure that your connections to remote computers work.
For more information, see Connecting to WMI on a Remote Computer.
- Connecting to WMI on remote computers requires the correct security settings, as explained in Maintaining WMI Security. The following table lists the topics that describe how to configure security settings with the scripting and application languages.
- After connecting to WMI, you can obtain data through queries and enumerations.
For more information, see Manipulating Class and Instance Information and Querying with WQL.
- Registry data is available through WMI and you can create new keys and values or modify existing ones.
For more information, see Modifying the System Registry.
- You can subscribe to event notifications through WMI, either temporarily between system reboots or permanently.
For more information, see Monitoring Events and Receiving a WMI Event.
- Performance counter data for a system is available through WMI.
The system performance library counters are converted to WMI classes. For more information, see Monitoring Performance Data.
- WMI Tasks for Scripts and Applications describes how to do many administrative tasks with WMI.
Providing Data to WMI
The following procedure describes how to supply data to WMI by writing a provider.
To supply data to WMI by writing a provider
Important Tasks for WMI
The following topics provide information about using WMI to monitor and control enterprise components.
| Topic | Description |
| WMI Tasks for Scripts and Applications | Describes how to find the correct WMI class and procedures to use in scripts and applications that perform common computer and network administration tasks, such as adding a new printer connection for a remote computer or finding all the installed hotfixes on a computer. |
| Creating a WMI Application or Script |
Any scripting language, such as VBScript, JScript, or Perl, that works with ActiveX objects can access WMI data. Applications can access WMI in C++, using the
COM API for WMI or in Visual Basic, using the Wbemdisp.tlb type library and the Scripting API for WMI.
|
| Connecting to WMI on a Remote Computer | Describes how scripts, applications, and providers can establish connections to WMI on remote computers to obtain data or control hardware and software. |
| Monitoring Events | Describes how to get event notifications by creating temporary or permanent WMI event consumers. |
| Providing Data to WMI | WMI supplies dynamic management data to client scripts and applications by obtaining it from providers. |
| Getting and Providing Data on a 64-bit Computer | Describes how to access nondefault providers and considerations for provider writers on 64-bit systems. |
Send comments about this topic to Microsoft
Build date: 11/3/2009