Share via


About the IIS WMI Provider

Windows installations are composed of numerous smaller systems that provide network access, data storage, and other features and services. These systems include devices such as printers and modems, and services such as the IIS Web service and e-mail. There are graphical user interfaces (GUIs) for managing Windows features. However, for Windows administrators with numerous features or many computers to manage, a scripting/programming solution provides an efficient alternative to manipulating a GUI.

Windows Management Instrumentation (WMI) is a powerful provider-based technology for managing the diverse systems and objects composing the Windows environment. Providers are developed to manage the objects of individual features, such as IIS or a printing service. The IIS WMI provider exposes a set of interfaces that offer administrators powerful and flexible ways to use scripts and programs to administer Web sites. Furthermore, the WMI provider is more full-featured than Active Directory Service Interfaces (ADSI) for managing the configuration of IIS.

important Important You must be a member of the Administrators group on the local computer to run scripts and executables, or you must have been delegated the appropriate authority. As a security best practice, log on to your computer using an account that is not in the Administrators group, and then use the Runas command to run your script or executable as an administrator. From the command prompt, type runas /user:administrative_accountname "script or executable command".

WMI and System Management

Administrators using a member of the Microsoft Windows.NET Server family can use WMI to manage systems composed of numerous devices, resources, and applications. Using WMI technology, these systems and components are represented using the Common Information Model (CIM). CIM can model anything in the managed environment, regardless of data-source location, by providing a consistent and unified view of objects. Managed objects are represented using object-oriented constructs, such as classes. These classes include properties that describe data and methods. WMI offers a powerful set of services that include manipulating managed objects such as, IIS metabase keys, or retrieving query-based information on managed objects.

WMI is designed to offer the following advantages over other available management technologies, such as ADSI:

  • Query Support: Administrators can select only the objects or properties they want to see, and WMI will return only the appropriate data. This high level of detail saves time for administrators, who no longer must sort through unneeded data.
  • Association: Because objects and properties may be associated outside the boundaries of a containment model, WMI allows selections and modifications by association across containment boundaries.
  • Global Object Model: A single Component Object Model (COM) application programming interface (API) exposes managed objects in IIS and other systems and applications depending only upon the availability of appropriate WMI providers.

The WMI Provider

When managing IIS with WMI, the object manager is the WMI provider and the managed object is the IIS metabase. The WMI provider serves as an instance and method provider. As an instance provider, the WMI provider maps the XML configuration elements from the metabase into WMI as a series of classes and instances. As a method provider, the WMI provider supports a series of methods you can call to add, remove, or modify the IIS configuration information in the metabase.

The WMI provider queries and manages the metabase in response to script or program commands as follows:

  1. A script or application executes and sends a query for IIS configuration classes to the WMI CIM Object Manager for validation. The query may select classes to acquire status, to call methods, or to set class properties.
  2. WMI CIM Object Manager compares the objects in the query with a database of WMI object definitions, the WMI Object Repository, to validate them as WMI objects.
  3. If the objects queried are all valid metabase objects, WMI CIM Object Manager forwards the query to the IIS WMI provider.
  4. The IIS WMI provider executes the query, call, or setting against the metabase configuration classes.

Diagram illustrating the steps required to update the metabase using the WMI IIS provider

The IIS WMI provider reads the metabase as a database of records, where each record is represented as an instance of a class. Each instance can then be queried to determine content, state, associations, and properties. The IIS WMI provider establishes relationships between objects, allowing you to tie together the various objects and all the objects contained within them. Management tasks can then be performed using asingle instance of the class, or many instancesof the class.

Comparing the ADSI and the IIS WMI Providers

The IIS WMI schema is congruent with the IIS ADSI Admin Objects schema, although the two technologies differ in architecture and features. The following table compares the architecture and features of the IIS ADSI provider with those of the IIS WMI provider.

Issue IIS ADSI provider IIS WMI provider
Query capabilities No. ADSI has no provision for queries. Yes. By querying on metabase key types, the IIS WMI provider returns only the data you need.
Object model and access routes COM: Scripts and programs. COM: Scripts, programs, and UI tools; for example, the WMI Object Browser.
Extensible schema Yes. ADSI provider supports metabase schema extensions. No. The IIS WMI provider can return existing schema extensions, but cannot extend the metabase schema.
Association or containment of related data Properties are related to IIS metabase keys by containment.

You can use the ADSI container object methods of the IIS Admin Objects to manipulate keys in the IIS metabase. You can create, delete, and move keys by creating, deleting, and moving IIS Admin Objects within container objects. You can also enumerate contained objects, such as virtual directories or servers with container object methods. ADSI supports property inheritance.

Properties are related to IIS metabase keys by containment or by association. Also, in conjunction with other providers, WMI supports associations with managed objects not in the metabase.

An association in WMI describes a relationship between classes and is in itself defined by a class. This powerful concept allows management information about an entire system of associated components to be viewed and traversed for tasks such as troubleshooting. Navigating associations to other classes is not limited by containment.