Share via


Lesson 3: Organizing Data from the IIS Metabase

In Lesson 2, we learned about the general structure of WMI: a provider namespace contains classes, which contain elements, which in turn contain properties and methods associated with those elements. The IIS WMI provider implements five different classes of elements beyond those that are inherited from the root namespace. Figure 2 illustrates how the IIS WMI provider follows the structure of WMI. Arrows indicate examples of association between elements.

Graphic applying the structure of WMI to the IIS WMI provider.

Figure 2

CIM_ManagedSystemElement

The CIM_ManagedSystemElement class contains elements that correspond to nodes of the Metabase Schema. For example, the IIsWebServer element is a schematic for an instance of an IIS Web server. The IIsWebVirtualDir element is a schematic for an instance of a Web virtual directory. These elements contain read-only properties and methods whereas the matching elements of the CIM_Setting class contain the writeable properties for the nodes. For example, the IIsWebServer element in the CIM_ManagedSystemElement class contains read-only properties for an IIS Web server, and methods that can set the properties in the IIsWebServerSetting element of the CIM_Setting class. The system was split in this way to take advantage of the inheritance that was possible in the CIM_ManagedSystemElement class. In Module 2 of this tutorial, the advantages of this structure are more apparent in CIM Studio.

CIM_Setting

As mentioned above, the elements of the CIM_Setting class correspond to nodes of the Metabase Schema, and contain the properties that can be set at those nodes. The methods that manipulate those properties are contained in the matching elements of the CIM_ManagedSystemElement class. Remember this class when you advance to Lesson 2: Viewing the Properties and Methods of the IIS WMI Provider in this tutorial. Remember that the IIsWebServerSetting element in this class, and IIsWebServer element in the CIM_ManagedSystemElement class, both refer to Web sites on your Web server, but that IIsWebServer contains the read-only properties of a Web site and that IIsWebServerSetting contains the writable properties of a Web site.

IIsStructuredDataClass

This is a unique class that contains elements whose data is represented in a complicated format in ADSI. For example, the ServerBindings property in ADSI is a string whose format must be IP:Port:Hostname. If the parts are out of order, or missing colons, an error occurs. In WMI, an element class was created called ServerBinding with three properties corresponding to the IP address, the port number, and the host name. Instances of these elements are considered objects. In WMI, elements, such as the IIsWebServerSetting element of the CIM_Setting class, can contain a property called ServerBindings, which is an array of ServerBinding objects.

CIM_Component

This is an association class that maps each element in the CIM_ManagedSystemElement class to another element in the CIM_ManagedSystemElement class so the elements can mimic ADSI containment. The properties of the elements of this class are references to the two associated elements. Every possible association between elements in the CIM_ManagedSystemElement class is represented by an element in the CIM_Component class.

CIM_ElementSetting

This is an association class that maps each element in the CIM_ManagedSystemElement class to its matching element in the CIM_Setting class. The properties of the elements of this class are references to the two associated elements. Every possible association between elements in the CIM_ManagedSystemElement class and elements in the CIM_Setting class is represented by an element in the CIM_ElementSetting class.

The classes described above represent the structure of the Metabase Schema file. Instances of the elements in each class contain current system information such as you would see in the Metabase Configuration File or in IIS Manager. For example, on a default installation of IIS 6.0, the IIsWebVirtualDir element of the CIM_ManagedSystemElement class and the IIsWebVirtualDirSetting element of the CIM_Setting class both contain three instances of Web virtual directories: one for W3SVC/1/Root, one for W3SVC/1/Root/Scripts, and one for W3SVC/1/Root/Printers. The instances contain current system data in their properties such as the physical paths to the virtual directories. The properties of the IIsWebVirtualDir instances are read-only, and the properties of the IIsWebVirtualDirSetting instances are writeable. Figure 3 illustrates the schema for the IIsWebVirtualDir element of the CIM_ManagedSystemElement class and three possible instances of the class.

Graphic illustrating the difference between the schema of WMI and instances of data built on that schematic design.

Figure 3