This documentation is archived and is not being maintained.

Getting Started Accessing WMI Data

.NET Framework 2.0

This section contains information about how to set up your development environment to use the System.Management namespace. It also shows how to perform basic administrative tasks using WMI in .NET Framework managed code.

WMI is typically used by users with administrative privileges. Users without these privileges will not be able to perform the following tasks:

  • Create, modify, or delete static WMI classes by default.

  • Perform operations that are not allowed by WMI providers.

    WMI security specified in WMI control is honored.

  • Deploy instrumented applications.

    However, users without administrative privileges can run instrumented applications when the application is deployed by a user with administrative privileges. The users without administrative privileges need rights granted to them to publish WMI instances or fire WMI events.

  • Generate early-bound classes for WMI classes that are located at secured WMI namespaces.

The topics in this section focus on tasks that access preinstalled WMI data or objects created by other WMI providers—the same client operations you may have programmed in scripts or applications using original WMI (WMI .

If you would rather access data or events from an instrumented application (a WMI data or event provider) instead of preinstalled WMI data, then you can use the information in Providing Management Information by Instrumenting Applications to create a provider and then use the information in this section to write a client application to access the WMI data your provider supplies.

For an example of a basic WMI in .NET Framework application, see A Simple System.Management Application.

The following topics will help you get started using WMI in .NET Framework.

Topic Description

How To: Set Up Your Development Environment to Use WMI .NET

How to set up a Visual Studio project for System.Management development.

WMI Queries

How to use methods of the ManagementClass class to enumerate or obtain a collection of WMI objects, and how to use the ManagementObjectSearcher class to query for a collection of objects that meet a specified criteria.

How To: Retrieve Information About Managed Objects by Queries

How to use query classes to obtain specified subsets of WMI objects.

How To: Execute a Method

How to execute methods of WMI objects.

WMI Management Events

How to use ManagementEventWatcher to subscribe to WMI events.

See Also