Share via


Metabase Schema

The metabase schema file defines what properties can exist in the metabase configuration file. The metabase schema also enforces which properties can be set at which keys. The schema provides this enforcement only for properties that are written as in-schema properties. Properties that are written to the metabase configuration that adhere to the rules of metabase schema are considered to be written in-schema. Properties that are not defined in-schema can be written in the metabase configuration as custom properties. Custom properties can be used in the metabase configuration to override schema enforcement or to configure a property with values other than the default values that are defined by the schema. For more information about in-schema and custom properties, see Writing Changes to MetaBase.xml.

The metabase schema is stored in an Extensible Markup Language (XML) file named MBSchema.xml, which is written into the in-memory metabase when IIS is started or restarted. By default, the MBSchema.xml file is located in the systemroot\System32\Inetsrv folder. For more information about how the MBSchema.xml file is written to the in-memory metabase, see Starting IIS.

Collections

The structure of the metabase schema is organized using containers called collections. The following sections discuss the different types of collections and their purposes. Collections are defined in MBSchema.xml using <Collection> start and end tags, and they are written in the following format:

  <Collection>
     InternalName ="CollectionName"
     AttributeName="AttributeValue">
</Collection>

CollectionName is the name of the collection, AttributeName is the name of a collection attribute, and AttributeValue is the value of the collection attribute.

All collections exist at the same hierarchical level in MBSchema.xml; therefore, no collection is a parent of another. Reading the MBSchema.xml file from top to bottom, the first collection, named MetabaseBaseClass, defines global settings in the schema.

The following code example is taken from the metabase schema file to illustrate how collections are defined. Spacing has been changed to display properly on this page.

  <Collection InternalName="MetabaseBaseClass" MetaFlagsEx="NOTABLESCHEMAHEAPENTRY"  MetaFlags="HIDDEN">
     <Property InternalName="Location" Type="WSTR"  MetaFlags="PRIMARYKEY"/>
</Collection>

The collection directly below MetabaseBaseClass is named IIsConfigObject. The IIsConfigObject collection is unique, because it is the collection in which all properties are defined. Only properties that are defined in the IIsConfigObject collection can be written to the metabase configuration as in-schema properties.

Properties

Properties are configuration objects that are associated with IIS Admin Objects and their corresponding Admin Base Objects (ABO). All properties that are defined in the IIsConfigObject collection contain attributes. The default values of these attributes for each property are also defined.

note Note The default values that are assigned to property attributes in the IIsConfigObject collection are not necessarily the values that are written to the metabase configuration when IIS is installed. The default values of attributes, defined by the IIsConfigObject collection, are used when you write a property as in-schema to the metabase configuration after IIS is installed.

Each property defined in the IIsConfigObject collection contains the following attributes: ID, Type, UserType, Attributes, InternalName, and DefaultValue. Some properties also contain the following attributes: MetaFlags, MetaFlagsEx, StartingNumber, and EndingNumber. Property attributes are contained in the <Property> start tag. The following sample from the IIsConfigObject collection illustrates how a property is defined

  <Property InternalName="ServerComment"
     ID="1015"
     Type="STRING"
     UserType="IIS_MD_UT_SERVER"
     Attributes="INHERIT"
     MetaFlagsEx="CACHE_PROPERTY_MODIFIED | WAS_NOTIFICATION"
     DefaultValue=""/>

Flags

In addition to attributes, some properties also contain flags. Each flag configures a unique functionality of the property, such as read or write access. Each flag is identified by the ABO using the flag's unique bitmask identifier. For more information about bitmask identifiers and their uses, see the Metabase Property Reference.

Flags contain attributes named Value and ID. Flags are defined in the property's start and end tags, and they are identified using <Flag> tags. The sum value of all flags that are set for a property determines the value of the property's DefaultValue attribute, which is also referred to as the property's default value. The following sample illustrates a property that contains flags.

  <Property InternalName="PasswordChangeFlags"
     ID="2068"
     Type="DWORD"
     UserType="IIS_MD_UT_SERVER"
     Attributes="INHERIT"
     MetaFlagsEx="CACHE_PROPERTY_MODIFIED"
     DefaultValue="0"
     EndingNumber="0">
      <Flag InternalName="AuthChangeUnsecure"   Value="1" ID="6292"/>
      <Flag InternalName="AuthChangeDisable"    Value="2" ID="6293"/>
      <Flag InternalName="AuthAdvNotifyDisable" Value="4" ID="6294"/>
</Property>

note Note Flags and their attributes are written in the property's start and end tags. Properties that do not contain flags are encapsulated in the properties' start tags, and they do not use end tags.

Remaining Collections

All remaining collections, which are below the IIsConfigObject collection, are organized by key type. These collections enforce at which keys in the metabase configuration a property can be written as an in-schema property. For example, if a collection named IIsWebServer contains the ServerComment property, IIS allows the ServerComment property to be written in any key in the metabase configuration using the IIsWebServer key type. Therefore, only properties that are contained in these remaining collections can be written (as in-schema properties) in a metabase key of the same key type in MetaBase.xml.

The exception to this rule is the IIsConfigObject key type, described earlier. Because all properties are contained in the IIsConfigObject collection, all properties can be written to any key in the metabase configuration of the IIsConfigObject key type.

Properties are written in these remaining collections in the following format:

  <Property InheritsPropertiesFrom="IIsConfigObject:PropertyName"/>

where PropertyName is the name of the property.

All properties that are contained by these remaining collections inherit their default values from the IIsConfigObject collection, because the IIsConfigObject collection is where all properties are defined.

You cannot use Active Directory Service Interfaces or Windows Management Instrumentation, which are not defined in metabase schema, to update properties in the metabase configuration. Changes that are written directly to the MetaBase.xml file by using a text editor (such as Microsoft Notepad) that do not comply with metabase schema rules might not get written to the in-memory metabase. If this occurs, an error or warning is sent to the Windows Events log.

Configuring the Schema

You can configure the schema by defining your own properties or by removing unwanted properties from the IIsConfigObject collection. This is also referred to as extending the schema. You also can add properties to, or remove properties from, collections to define your own enforcement of rules as to which keys in the metabase configuration a particular property can be written.

important Important Before configuring the metabase schema, you should first ensure that the changes you intend to make will not adversely affect your metabase configuration. Before removing properties from the IIsConfigObject collection, for example, ensure that the property that you intend to remove from the schema does not exist in the metabase configuration.

Editing the MBSchema.xml file directly, by using a text editor such as Notepad, is not supported. Changes to metabase schema must be made programmatically. For more information about extending the schema, see Extending the Metabase Schema.