Metabase Configuration File
The metabase configuration file, named MetaBase.xml by default, stores the IIS configuration settings. The MetaBase.xml file is organized in a hierarchical structure, which can vary depending on the choices that are made when IIS is installed and, if applicable, later reconfigured. When IIS is started or restarted, the configuration settings are read from MetaBase.xml and copied into the IIS cache in memory, which is referred to as the in-memory metabase. When IIS Manager or programmatic interfaces are used to change IIS configuration, the changes are made to the in-memory metabase and persisted to MetaBase.xml after a previously configured number of changes or according to regular time intervals.
Because MetaBase.xml is a plain-text file, you can read and configure it using common editing tools, such as Microsoft Notepad. It is recommended that you become familiar with the structure of MetaBase.xml before attempting to configure IIS by changing the MetaBase.xml file.
Terminology Specific to XML
Because MetaBase.xml is an Extensible Markup Language (XML) file, familiarity with XML terminology and metabase terminology helps in understanding the structure of the MetaBase.xml file. The following tables define both terminologies. The structure of the MetaBase.xml file is presented with the associated terminology in the MetaBase.xml code sample.
XML Terminology
The MetaBase.xml file is constructed with XML elements. The following table identifies and defines the XML terms and relates them to their use in MetaBase.xml.
Table 1: XML Terminology and Relation to MetaBase.xml
Term | XML Description | Relation to MetaBase.xml |
---|---|---|
XML declaration | A processing instruction at the start of an XML document, such as <?xml version ="1.0"?> , that declares the file to be XML code. |
The first line in MetaBase.xml is an XML declaration. |
Element | A logical unit of information. Elements are surrounded by <element name> and </element name> tags, where element name is the name of the element. Elements can contain attributes. | Keys and custom properties are written using XML elements. |
Root element | A single element that contains all the other elements and character data that make up an XML document; also known as a document element. | MetaBase.xml contains a root element called <configuration>. |
Start tag | A tag that marks the start of an element, such as <element name>, where element name is the name of the element. | In MetaBase.xml, start tags are used to identify the start of a key or custom property. |
End tag | A tag that marks the end of an element, such as </element name>, where element name is the name of the element. | In MetaBase.xml, end tags are used to identify the end of a key or custom property. |
Element type | Indicated by the name that occurs in its start tag and end tag. | In MetaBase.xml, the element type for metabase keys is actually the value of the KeyType property. For example, IIsWebService is the KeyType that is used to identify the Web service key. Custom properties use the name Custom as the element type. |
Attribute | A name and value pair that is associated with an element and that provides more information about the content of that element. | Metabase properties contain several attributes that describe the characteristics of the property, such as the data type or value. Keys also contain attributes, such as the Location attribute or the DefaultDoc attribute found within the IIsWebService key. |
Comment | A piece of text, separated by <!-- and --> tags, containing words that are not to be treated as part of the document. | In MetaBase.xml, comments are separated by <!-- and --> tags, and must be written above the key to which they pertain. If you put comments inside an XML node, it will be removed. Also no comments are allowed above IIS_Global node. |
Metabase Terminology
MetaBase.xml is structured using keys. Keys are analogous to file folders in a file system or registry keys in the registry. Each key contains a Location attribute, which specifies its hierarchical location in the metabase. Properties, which define the values for configuring IIS, are contained in keys. Because MetaBase.xml is structured hierarchically, a particular property can be configured differently at different keys. Properties contain attributes, such as the Value attribute. Some properties, such as the AccessFlags property, also contain flags. For a more detailed list of all properties and their attributes that are defined in-schema, see the Metabase Property Reference.
The following table summarizes the metabase terminology that is used to describe the structure of MetaBase.xml. These terms are discussed in more detail later in this topic.
Table 2: MetaBase.xml Terminology
Term | Description |
---|---|
Key | A hierarchical container in MetaBase.xml that is used to contain properties. Each key contains the Location attribute within the start tag of the key, specifying the hierarchical position of the key in MetaBase.xml. A metabase key is analogous to a file folder or registry key. |
Location | Each key contains a Location attribute, which is a sequence of location names, separated by a forward slash (/), that uniquely identifies the hierarchical position of the key in MetaBase.xml. For example "/LM" is the location name of the IIsComputer key, and "/LM/W3SVC" is the location of the IIsWebService key. The latter is a child key of the "LM" location. A child key is a key that is contained by another key. |
Property or Custom Property | A property or custom property defines values that are used to configure IIS. Properties contain attributes, and some properties, such as AccessFlags, also contain flags. Properties are contained by keys and can be written, in MetaBase.xml, as in-schema or custom. |
Attribute | Metabase properties contain several attributes that describe the characteristics of the property, such as the data type or value. Keys also contain attributes, such as the Location attribute or the DefaultDoc attribute found within the IIsWebService key. |
Flag | A flag is a particular bit within the DWORD value of a property that contains flags. Each flag within a property is used to configure particular functionality of the property, such as read or write access. The sum of the flag values for a property becomes the sum of the value attribute for that property. |
For more information about properties, attributes, and flags, see the Metabase Schema topic. For more information about writing properties to MetaBase.xml as in-schema or custom, see Writing Changes to MetaBase.xml.
Keys and Locations
Metabase keys are analogous to registry keys or a directory in a file system. Each metabase key is identified by its name and location, which are defined within the start tag of the key. The following example shows two keys, IIsConfigObject and IIsLogModules, each having a unique location as defined by the value of its respective Location attribute:
<IIsConfigObject Location ="/LM/IISADMIN"
<!-- Properties are defined here -->
>
<IIsLogModules Location ="/LM/Logging"
<!-- Properties are defined here -->
</IIsLogModules>
Most keys are named using the value of the KeyType property, also known as the Admin Base Object (ABO) class name, which relates to the type of key being defined. The IIsLogModules key, seen in the example above, is named this way. If you change the KeyType value of a metabase key programmatically, the name of the key changes in MetaBase.xml when the in-memory metabase is saved. This KeyType value is important because the collection in-schema that is named using the same KeyType enforces which properties the key can contain.
Keys named IIsConfigObject are special because they are not named using a KeyType value. Because all properties are defined in-schema in the IIsConfigObject collection, keys in MetaBase.xml that are named IIsConfigObject can contain any property. You can specify a KeyType value for a key named IIsConfigObject by writing the KeyType property in the key as a custom property.
Unlike key names, which are not unique for all keys, the value of the Location attribute must be unique for each key. The Location attribute defines the hierarchical position of a key in MetaBase.xml. The value of the Location attribute, with only two exceptions, is a sequence of location names, separated by a forward slash (/), that uniquely identifies the hierarchical position of the key in MetaBase.xml.
The exceptions are the IIS_Global key, which has the highest hierarchical position in MetaBase.xml (Location ="."), and the IIS_ROOT key, which has the next-highest hierarchical position in MetaBase.xml (Location ="/"). The next-highest hierarchical position is the IIsComputer key (Location ="/LM"). All remaining keys in MetaBase.xml are contained by the IIsComputer key; therefore, their location always begins with /LM/location name, where location name is the name of the location.
The hierarchical position of any metabase key can be determined by looking at its Location attribute. For example "/LM" is the location of the IIsComputer key, and "/LM/W3SVC" is the location of the IIsWebService key. Because the "/LM/W3SVC" location begins with "/LM" followed by a forward slash character (/) and another location name (W3SVC), the IIsWebService key at location "/LM/W3SVC" is a child of the IIsComputer key. A child key is a key that is contained by another key. A key that contains another key is sometimes referred to as a parent key.
Metabase Structure
The metabase keys and elements that are described in this section are illustrated in the MetaBase.xml sample later in this topic.
As with any other XML file, the XML declaration <?xml version ="1.0"?> occupies the first line in MetaBase.xml and indicates that the file is formatted as XML. The root element, which is named <configuration>, contains all other elements.
The IIS_Global key is the key at the highest level key in the metabase that contains properties. Consider the IIS_Global key to be read-only; do not configure its properties.
The IIS_ROOT key (Location ="/") is the highest key in which you can configure properties. Properties that are configured at the IIS_ROOT key affect the way that IIS runs overall.
The IIsComputer key (Location ="/LM") contains all remaining metabase locations. Table 3 lists, in hierarchical order, child locations that can exist within the namespace of the /LM location. The File Transfer Protocol (FTP), Network News Transfer Protocol (NNTP), and Simple Mail Transfer Protocol (SMTP) components are not installed by default. Therefore, the /LM/EventManager, /LM/NNTPSVC, and /LM/SmtpSvc locations do not exist in MetaBase.xml unless their respective components are installed.
The Local Machine Namespace
The local machine (LM) namespace is the parent location in the hierarchical structure of keys where all services and sites are organized. These keys, each of which contain their own unique location, are organized in the following format:
/LM/Service/Site/ROOT/Virtual Directory/Directory/File
Where the replaceable parameters are:
Service = MSFTPSVC, NNTPSVC, SmtpSvc, or W3SVC
SiteIdentifier = unique number identifier for the FTP, NNTP, SMTP, or Web, site
ROOT = root virtual directory of the site
Virtual Directory = virtual directory
Directory = physical directory
File = file
Each site is a server instance, and it is referred to by the number that is used in its namespace. For example, /LM/W3SVC/1 specifies the location of the key that contains the first Web site, and /LM/MSFTPSVC/3 specifies the location of the key that contains the third FTP site.
The following table lists the locations of the parent keys that are contained in the LM namespace. Because their child keys are too numerous, they are not listed here. For a list of all locations where a particular property can be configured, see the Metabase Property Reference.
Table 3: Local Machine Locations
Location | Description |
---|---|
/LM/EventManager | The /LM/EventManager location and its child locations configure Microsoft Exchange. You should not configure keys at the /LM/EventManager location or its child keys by editing the MetaBase.xml file. |
/LM/IISADMIN | The /LM/IISADMIN location and its child locations record distributed COM (DCOM) extensions to IIS. Because the /LM/IISADMIN location is internally configured by IIS, you should not configure /LM/IISADMIN or its child locations. |
/LM/Logging | The /LM/Logging location and its child locations configure IIS logging. |
/LM/MimeMap | The /LM/MimeMap location configures the MimeMap property. |
/LM/MSFTPSVC | The /LM/MSFTPSVC location and its child locations configure the FTP service and sites. |
/LM/NNTPSVC | The /LM/NNTPSVC location and its child locations configure the NNTP service and sites. |
/LM/SmtpSvc | The /LM/SmtpSvc location and its child locations configure the SMTP service and sites. |
/LM/W3SVC | The /LM/W3SVC location configures properties that are global to the Web service. |
/LM/W3SVC/1 | The /LM/W3SVC/1 location and its child locations configure properties that are specific to the first Web site. |
/LM/W3SVC/AppPools | The /LM/W3SVC/AppPools location configures properties that are global to all application pools. Child locations, such as /LM/W3SVC/AppPools/DefaultAppPool, configure properties that are specific to a particular application pool. |
/LM/W3SVC/Filters | The /LM/W3SVC/Filters location and its child locations configure Internet Server API (ISAPI) filters and compression schemes. |
/LM/W3SVC/Info | The /LM/W3SVC/Info location configures properties that are global to all Web sites. |
/LM/W3SVC/Info/Templates | The /LM/W3SVC/Info/Templates location and its child locations were used by the IIS Permissions Wizard in previous versions of IIS. It remains solely for legacy compatibility. You should not configure keys at the /LM/W3SVC/Info/Templates location by editing the MetaBase.xml file. |
MetaBase.xml Sample
The following code sample illustrates the structure of the MetaBase.xml file. XML comments precede each line that they pertain to, describing the metabase structure. In the XML comments, the metabase terminology is shown in bold, and the XML terminology is shown in italic.
Note that in this sample there are two instances of the IIsWebServer key, and both instances have a unique location. The first, which is /LM/W3SVC/1, is the key where the default Web site is configured. The second, which is /LM/W3SVC/2, is the key where the second Web site is configured. In actual use, the Default Web site is numbered 1, but any additional Web sites created are assigned a random number.
<!-- The XML declaration -->
<?xml version ="1.0"?>
<!-- The Root Element -->
<configuration xmlns="urn:microsoft-catalog:XML_Metabase_V2_0">
<!-- Element -->
<MBProperty>
<!-- Key, Start tag containing a location attribute -->
<IIS_Global Location ="."
<!-- Property
(in-schema) -->
BINSchemaTimeStamp="c0ed73cdbcd8c001"
<!-- Property (in-schema) -->
ChangeNumber="888"
<!-- Property (in-schema) -->
HistoryMajorVersionNumber="154"
>
<!-- End tag -->
</IIS_Global>
<!-- Key,
Start tag containing a location attribute -->
<IIS_ROOT Location ="/"
<!-- Property (in-schema) -->
AdminACL="A really long
number"
>
<!-- End tag -->
</IIS_ROOT>
<!-- Key,
Start tag containing a location attribute -->
<IIsComputer Location
="/LM"
<!-- Property (in-schema) -->
MaxBandwidth="4294967295"
<!-- Property (in-schema) -->
EnableEditWhileRunning="0"
>
<!-- End tag -->
</IIsComputer>
<!-- Key,
Start tag containing a location attribute -->
<IIsWebService Location
="/LM/W3SVC"
<!-- Property (in-schema) -->
AllowKeepAlive="TRUE"
<!-- Property (in-schema) -->
AnonymousPasswordSync="TRUE"
>
<!-- End tag -->
</IIsWebService>
<!-- Key,
Start tag containing a location attribute -->
<IIsWebServer Location
="/LM/W3SVC/1"
<!-- Property (in-schema) -->
AppPoolId="DefaultAppPool"
<!-- Property (in-schema) -->
DefaultDoc="Default.htm,Default.asp"
<!-- Property (in-schema) -->
ServerComment="Default Web Site"
>
<!-- Property (custom) -->
<Custom
<!-- Attributes -->
Name="SecureBindings"
ID="2021"
Value=":443:"
Type="MULTISZ"
UserType="IIS_MD_UT_SERVER"
Attributes="NO_ATTRIBUTES"
/>
<!-- End tag --></IIsWebServer>
<!-- Key, Start tag containing a location attribute -->
<IIsWebServer Location ="/LM/W3SVC/2"
<!-- Property (in-schema) -->
SecureBindings=""
<!-- Property (in-schema) -->
ServerBindings=":6186:"
<!-- Property (in-schema) -->
ServerComment="My 2nd Web Site"
>
<!-- End tag -->
</IIsWebServer>
<!-- End tag -->
</MBProperty>
<!-- End tag -->
</configuration>
Related Topics
- For a more detailed list of all properties and their attributes that are defined in-schema, see the Metabase Property Reference.
- For information on properties, attributes, and flags, see Metabase Schema.
- For information on writing properties to MetaBase.xml as in-schema or custom, see Writing Changes to MetaBase.xml.
- For information on configuring MetaBase.xml, see Configuring the Metabase.
- For information on metabase comments, see Adding Metabase Comments.