IIS WMI ProviderSpecificationInternet Information ServerMicrosoft Confidential |
Author |
Richard
Ersek |
Area |
IIS |
Program Management
Contact |
Richarde |
Development
Contact |
RCraig |
Test
Contact |
BrunoKC |
Current
Status |
In
development |
Test
Plan |
Complete – see
BrunoKC |
The IIS WMI provider provides access through COM object interfaces to IIS metabase data, including the metabase schema and methods on objects instantiated from the metabase. WMI is used by Windows 2000, management tools and scripts to manage systems composed of numerous devices, resources and applications. The IIS WMI provider is intended to provide similar functionality to the IIS ADSI provider for the metabase, which it may replace over time as the preferred interface for IIS administration.
The goal of the IIS WMI provider is to provide manageability of IIS at a level of functionality equivalent to the IIS ADSI provider and to support an extensible schema. We will do this in a way that is consistent with the IIS Metabase for IIS 5.1 and consistent with the IIS XML schema for IIS 6.
Specifically, this requires a WMI schema that is congruent with the IIS ADSI Admin Objects schema. While they may differ in ways specific to the respective object and data models for ADSI and WMI, the two will offer equivalent functionality. In other words, a script written for a task using the ADSI model would also be able to be written for the WMI model. The effects on the metabase would be equivalent.
Likewise, schema extensions would be equivalent. If a change can be made to schema in the WMI provider, it will be available to clients of the ADSI provider. For IIS 5.1, the provider will not support schema extensions by either exposing extensions made to the metabase or by extending the schema using WMI. Schema extensions will be supported in IIS 6.0.
· WMI Event Provider - IIS Server events will be supported at a later date exposed through a WMI event provider. This feature is described in detail in the spec: http://iis/IIS6/specs/src/iis51_avail_event.htm. Events are not supported in the current WMI provider. However, WMI is capable of generating events on property changes on a class instance.
WMI users will access metabase nodes, properties, methods and events through the COM object instances of WMI classes. This facilitates access through:
· Windows Scripting Host (WSH) scripts
· User-written Visual Basic, C++ and Java applications
· Management tools and middleware written by ISVs and Microsoft
· Enterprise products such as Microsoft Exchange
Example: The Web Appliance group uses Chameleon, a middleware product for administering a server and the applications and resources running on it. Chameleon uses the Resource Kit WMI provider to access the IIS metabase and methods on server objects modeled after the ADSI object for IIS. For WMI users, the IIS settings and methods are a part of the management domain encompassing the server, applications running on the server, and resources available. These components are often related and dependent on each other. Users may want to change a single attribute across all components in the management domain in a single operation. For example, removing a user from the system requires accessing all user objects on the server having an instance of the user being removed. |
WMI users will be able to read and write all metabase
properties. Configuration changes
made through the WMI provider, ADSI provider, Admin Base Objects, text file
editing or any other valid method will be available to WMI users and to users
accessing the metabase through any other means.
The metabase implements a
containment model providing property inheritance for child nodes and the ADSI
Admin Objects enforce rules governing which properties can be set based on the
node’s key type and where the node lives in the metabase path. Although WMI has no concept of
containment or property inheritance, the WMI provider will need to be aware of
key types and metabase paths and provide validation of settings based on the
rules for which properties and nodes can be created or set on a given path.
Example: Susan uses the WMI provider to set the ServerBindings property to a value of 1080 on the IISWebServer instance using the metabase path ‘/LM/W3SVC/1’. The operation succeeds. She then tries to set the ServerBindings property to 1080 on the IISWebServer instance using the metabase path ‘/LM/W3SVC’. This time the operation fails because the metabase path is invalid for that class. Later, another user changes the ServerBindings property back to 80 for the path ‘/LM/W3SVC/1’. When Susan checks this value using the WMI provider interface, she sees that the value has changed. |
The WMI provider will provide dynamic instances of subclasses of CIM_ManagedSystemElement that contain methods for managing IIS entities such as services, applications, web directories and files.
WMI users will access methods on WMI objects that match methods on equivalent ADSI objects. The methods will provide equivalent functionality to their ADSI counterpart when called.
Example
– listing Virtual Directories
Set
VDirSettings = GetObject("winmgmts:root\MsIIs").ExecQuery ("select * from
MicrosoftIIS_WebVirtualDirSetting where AccessWrite !=
TRUE")
For
Each Setting in VDirSettings
WScript.Echo
Setting.Name, Setting.AccessWrite
Next
Example
– creating a web site
BindingsList
= Array(0)
BindingsList(0)
= ":83:"
WPort
= BindingsList ' Port property is a
collection of port bindings
Set
ServerClass =
GetObject("winmgmts:root/MsIIs:MicrosoftIIS_WebServer")
Set
ServerObj = ServerClass.SpawnInstance_()
ServerObj.Name
= "W3SVC/20"
ServerObj.Put_()
Set
ServerSettingClass =
GetObject("winmgmts:root/MsIIs:MicrosoftIIS_WebServerSetting.Name='W3SVC/20'")
Set
ServerSettingObj = ServerSettingClass.SpawnInstance_()
ServerSettingObj.Name
= "W3SVC/20"
ServerSettingObj.ServerSize
= 1 ' Medium-sized
server
ServerSettingObj.ServerComment
= "SampleWMISite"
ServerSettingObj.ServerBindings
= WPort
ServerSettingObj.Put_()
Set
VDirClass =
GetObject("winmgmts:root/MsIIs:MicrosoftIIS_WebVirtualDir")
Set
VDirObj = VDirClass.SpawnInstance_()
VDirObj.Name
= "W3SVC/20/ROOT"
VDirObj.Put_()
Set
VDirSettingClass =
GetObject("winmgmts:root/MsIIs:MicrosoftIIS_WebVirtualDirSetting")
Set
VDirSettingObj = VDirSettingClass.SpawnInstance_()
VDirSettingObj.Name
= "W3SVC/20/ROOT"
VDirSettingObj.AccessRead
= True
VDirSettingObj.AccessWrite
= True
VDirSetting.EnableDirBrowsing
= True
VDirSetting.Path
= "d:\delme"
VDirSetting.Put_()
ServerObj.Start()
Schema changes affect both the schema and the internal structure of the IIS metabase. The following schema changes can be made to the metabase:
· Adding new properties to a node: A node in the XML schema can contain zero or more properties. Users can add new properties to the node to enhance the descriptive capabilities of the node. For example, each website has an instance of the IISWebServer node. Adding an IISWebCustomer property to the node would allow an ISP to identify a site with the customer that owns the site. The WMI provider will enforce which properties can be created on a node based on the metabase key type, matching the validation currently implemented in the ADSI provider.
· Creating new schema nodes: Users may create a new node to contain user and/or application-specific properties. For example, an application may create a node MySiteSetttings under the IISWebServer node. User-defined nodes are instantiated as defined by the node’s key type in the ADSI object model.
Schema Synchronization
The WMI provider will coordinate schema synchronization with the metabase in IIS 6. New properties added to a node will be reflected as new properties on a class derived from CIM_Setting. New metabase nodes will be exposed via WMI as new instances of an extended IIS settings class derived from CIM_Setting.
In IIS 5.1, the WMI provider will use static schema only. This effectively means that only the ‘out-of-the-box’ metabase schema is available. Schema extensions to the metabase made through other means, such as the ADSI provider, will not be exposed via the IIS 5.1 WMI Provider.
Schema Extensibility
The WMI provider will also provide methods in IIS 6 for extending the schema by creating new nodes and properties in the metabase. The methods must validate the IIS metabase rules governing which nodes can be created under a given node type and which properties can be created under a given node type. When new schema elements are created, the WMI provider will populate the properties of those elements according to the metabase user types and property attributes for that metabase node.
We know the metabase schema will change from IIS 5.1 to IIS 6. For example, configuration will be added for the IIS 6 process model (application pools, compatibility modes). The IIS 6 WMI provider will accommodate these changes in the same way it supports extensible schema. As the metabase schema changes across versions, the IIS 6 provider will dynamically generate the WMI schema.
The WMI provider implementation should not impede the performance of the Metabase for clients accessing the Metabase via other means such as Admin Base Objects or the XML configuration files.
The managed object file (MOF) IISProvider.mof provides a description of the IIS WMI Provider schema and can be viewed in the WMI CIM Studio application provided in the WMI section of the Platform SDK. A copy of IISProvider.mof is available at http://iis/IIS6/specs/src/iisprovider.mof.
The IIS WMI provider will use the MicrosoftIISv2 CIM namespace.
The WMI schema consists of:
· Subclasses of CIM_ManagedSystemElement, representing the running state and methods on IIS system elements such as the services, websites, applications, virtual directories and files
· Subclasses of CIM_Setting representing properties on nodes in the metabase
· Association classes that link system elements to their settings and association classes that model the relationship between classes (such as the containment model for Vdirs, Web Directories and Web Files
Associations are also used to relate IIS system elements to application infrastructure and operating system entities.
Creating a new instance creates a new backup
Deleting an instance deletes a backup
AppStatus
AppEnabled
The IIS WMI Provider implements two WMI provider types in a single process:
· Instance Provider – which provides dynamic instances of WMI classes for IIS system elements which expose the system state relevant to that element.
· Method Provider – provides method implementations on dynamic instances of WMI classes.
A separate WMI event provider will be available for 6.0. The spec is located at http://iis/IIS6/specs/src/iis51_avail_event.htm.
For IIS 5.1, the WMI provider uses a fixed schema implemented in the provider’s data structures for predefined entries in the metabase (i.e. those which ship out of the box for IIS 5.1) and it cannot generate instances of classes that are created through user-provided schema extensions.
Issue: In IIS 6, the WMI provider will obtain its schema from the XML metabase schema. Options for generating class instances for schema extensions include:
· A class provider to be used for extensions to fixed schema.
· Appending the schema extensions to the provider’s MOF and compiling it each time the provider is started.
Date |
Changes |
By |
4/21/00 |
Created |
richarde |
4/25/00 |
Updated with new schema
information, distinguished features between IIS 5.1 and IIS
6.0 |
richarde |
6/1/00 |
Added more detail on
feature goals and requirements |
richarde |
6/29/00 |
Updated to reflect
latest specifications for the IIS 5.1 WMI
provider |
richarde |