Configuring the IIS server results in properties being set at appropriate locations (or keys) in the metabase according to the rules in the schema. Most of these properties can be set using IIS Manager or the command-line scripts that are installed with IIS. To write your own custom command-line scripts or applications, use the following technologies:
IIS 5.1 and earlier: The IIS WMI provider is not available.
The IIS Metabase Properties reference contains reference pages for each of the IIS metabase properties. Instructions on how to use the information contained in each page are outlined in the following sections below:
Each property has a set data type when configuring the property from ADSI or WMI (on IIS 6.0). These data types are declared in the schema. For example, AspScriptLanguagecan only be a String value. This information is useful if you write a command-line script or application using a programming language that requires you to declare a variable as a specific data type. Possible ADSI/WMI data types of metabase properties are as follows:
-
BINARY
-
BOOL
-
DWORD
-
EXPANDSZ
-
IPSECLIST
-
MIMEMAP
-
MULTISZ
-
NTACL
-
STRING
-
WSTR
Each property has a set data type when configuring the property from ABO. For example, schemacan only be a STRING_METADATA value. Possible ABO data types of metabase properties are as follows, and are defined in the Mddefw.h header file:
-
BINARY_METADATA
-
DWORD_METADATA
-
EXPANDSZ_METADATA
-
MULTISZ_METADATA
-
STRING_METADATA
Some properties have a default value declared in the schema, which is not necessarily the default that IIS configures when the property is initially set. Schema defaults are used by ADSI and WMI (on IIS 6.0). Note that ABO has no defaults registered for metabase properties.
When a service of IIS is installed (Web, FTP, SMTP, or NNTP), a default site is configured for that service. IIS creates all the necessary metabase paths and locations, and sets the appropriate properties for that site. Possible values to which IIS might set a property are listed in this section of the metabase property reference pages. If an internal default is "not specified", that is because IIS setup does not have a default listed for that property.
If the property has a possible range of values, the upper bound is listed in this section. This typically applies to properties whose data type is DWORD.
If the property has a possible range of values, the lower bound is listed in this section. This typically applies to properties whose data type is DWORD.
Each property has a unique numerical identifier which IIS recognizes internally. This is useful when writing C/C++ applications that use ABO.
Identifiers used by IIS are assigned from a pool of reserved numbers. If you create new identifiers in the metabase, use identifier numbers greater than 65535 (0x0000ffff) to avoid conflicts with current or future system data. Identifiers are defined in the IIScnfg.h header file. The following ranges are reserved by IIS:
Range |
Reserved for |
---|---|
1 (0x00000001) to 32767 (0x00007fff) |
IIS identifiers. |
28672 (0x00007000) to 32767 (0x00007fff) |
The subset of ASP identifiers. |
32768 (0x00008000) to 36863 (0x00008fff) |
FrontPage Server Extensions identifiers. |
36864 (0x00009000) to 40959 (0x00009fff) |
SMTP identifiers, owned by Exchange. |
40960 (0x0000a000) to 45055 (0x0000afff) |
POP3 identifiers, owned by Exchange. |
45056 (0x0000b000) to 49151 (0x0000bfff) |
NNTP identifiers, owned by Exchange. |
49152 (0x0000c000) to 53247 (0x0000cfff) |
IMAP identifiers, owned by Exchange. |
53248 (0x0000d000) to 57343 (0x0000dfff) |
MSCS identifiers. |
57344 (0x0000e000) to 61439 (0x0000efff) |
Application Center identifiers. |
To relieve a Web developer of having to memorize numerical identifiers, friendly names for each identifier are defined in the iiscnfg.h header file. Include iiscnfg.h in your C/C++ applications if you want to use the friendly names instead of numerical identifiers. You can obtain a copy of iiscnfg.h by installing the IIS SDK from CD (part of the Platform SDK CD) or by downloading the IIS SDK from Platform SDK Update.
Attributes identify inheritable properties. For example, if an inheritable property is set at a parent location (or key), each child location (or key) can inherit the property and value unless it is already explicitly set at the child.
When retrieving data with ABO, you can get inherited data by setting the METADATA_INHERIT flag in the dwMDAttributes member of the METADATA_RECORD structure that is passed to the GetData or EnumData method. For the GetAllData method, you must specify the METADATA_INHERIT flag in the dwMDAttributes parameter. If the METADATA_INHERIT flag is not set, inherited data is not returned.
The following attributes are used by IIS, and are defined in the Mddefw.h header file:
XML Attribute |
ABO Attribute Name |
Meaning |
---|---|---|
INHERIT |
METADATA_INHERIT |
Property and value are inheritable. |
REFERENCE |
METADATA_REFERENCE |
The value of the property is a structure like an access control list (ACL). |
SECURE |
METADATA_SECURE |
The value contained in the property is encrypted because it is considered sensitive data. For example, properties that contain passwords are marked at SECURE. |
NO_ATTRIBUTES |
METADATA_NO_ATTRIBUTES |
Confirms that no attributes are set for the property, and therefore the property is not inheritable. |
VOLATILE |
METADATA_VOLATILE |
Property and value are not inheritable because IIS changes the value frequently. For example, the value of ServerState changes every time the server is paused, stopped, or started. |
The user type is a DWORD that specifies how the property value is used. User types enable IIS to classify properties by application. You can use the user type to filter data requested from a location (or key). For example, the ABO GetAllData method has a parameter, dwUserType, you can set to specify that only data of a certain user type is to be returned. For example, if this parameter is set to IIS_MD_UT_SERVER during the method call, only data related to the server will be returned. IIS user types are defined in the IIScnfg.h file, and are listed in the following table:
User Type |
Application |
---|---|
ASP_MD_UT_APP |
ASP application properties such as AppAllowDebugging and AspScriptTimeout. |
IIS_MD_UT_FILE |
File and directory properties such as HttpErrors, MimeMap, and Path. |
IIS_MD_UT_SERVER |
Server properties such as ServerComment, SessionKey, and ConnectionTimeout. |
IIS_MD_UT_WAM |
Web application properties such as AspRequestQueueMax and AppPackageName. |
In each property reference page, the Configurable Locations table lists locations (or keys) in the metabase where a property is allowed to be set. For example, the LogAnonymous property can only be set at locations which are IIsFtpServer administration objects or IIsFtpService administration objects (such as /LM/MSFTPSVC or /LM/MSFTPSVC/ n). This is because LogAnonymous is only used by the FTP service at those locations. Conversely, the KeyType property can be set at almost every possible location because that property is used to identify the administrative object type of the location (or key).
Some DWORD properties can be considered as a collection of bit flags that indicate different options for that property.
For example, the AccessFlags property contains flags that specify different levels of security access like AccessRead, AccessWrite , and so on. You can use WMI (IIS 6.0 only), ADSI, or ABO to set properties with flags to a DWORD value. If the AccessFlags property is set to 529, this is equal to 0x00000211 in hexadecimal. Broken down, 0x00000200 refers to the AccessScript flag, 0x00000010 refers to the AccessSource flag, and 0x00000001 refers to the AccessRead flag.
An alternative way to set flag properties is to set their virtual properties, via ADSI only. For example, to set AccessFlags to allow script and read access, you can use ADSI to set the AccessScript and AccessRead virtual properties to 1. Every property that contains flags has virtual properties in ADSI that match each flag name.
Some DWORD properties can be considered as a collection of bit flags that indicate different options for that property.
A bitmask is a value that IIS uses with bit-wise operators (And, Eqv, Imp, Not, Or, Xor) to test the state of individual bits in a bit-mask (in the case of the metabase, the bit-mask is the value of a DWORD property that contains flags). Use bitmask values of flags to build a DWORD value for the property that contains flags. See Flags above for an example.
To relieve a Web developer of having to memorize numerical bitmasks, friendly names for each bitmask are defined in the iiscnfg.h header file. Include iiscnfg.h in your C/C++ applications if you want to use the friendly names instead of numerical identifiers. You can obtain a copy of iiscnfg.h by installing the IIS SDK from CD (part of the Platform SDK CD) or by downloading the IIS SDK from Platform SDK Update.