IIS Scripting API

IIS Scripting API

 

Metabase Concepts

The following table describes concepts that help to understand the structure of the metabase.

Term Description

Node or Key

A hierarchical container in the IIS metabase. Each node enables a specific set of properties to be configured at that location or path. For example, at the Web service node, identified by the IIsWebService IIS Glossary at the /LM/WSVC path in the metabase, certain properties like AppRoot can be set that affect the IIS Web service. A node is a child of another node if its path includes the path of the parent (for example, /LM/WSVC/1 is a child node of /LM/WSVC).

Path or Location

A path in the metabase uniquely identifies the hierarchical position of a node. For example /LM (local machine) is the path of the IIsComputer admin object, of which there can be only one. However, the IIsWebVirtualDir admin object can exist at several paths in the metabase, such as /LM/W3SVC/1/ROOT, /LM/W3SVC/2/ROOT, and /LM/W3SVC/2/ROOT/MyVDir.

IIS 6.0: Each key in the metabase contains a Location attribute that specifies the path.

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 nodes in the metabase. Custom properties are not defined in the schema, but are configurable in the metabase as IIsCustom and contained in the IISConfigObject parent node.

Attributes

Metabase properties contain several attributes that describe some characteristics of the property, such as the INHERIT attribute.

IIS 6.0: Not to be confused with XML attributes set in the Metabase.xml file, such as the Location attribute.

Flags

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.

Collections

The structure of the metabase schema is organized using containers called "collections."

Inheritance

To keep the size of the metabase manageable, IIS allows inheritance of properties from parent node to child node. Not all properties are inheritable properties. If an inheritable property is explicitly set at a child node, the explicit value overrides the inherited value.

It is recommended that you do not rely heavily on inheritance. Each inherited property requires extra processing time to allow its value to be obtained from the parent node, and therefore negatively impacts performance.

 

 

This section includes the following topics:

ADSI Object Description

IIsApplicationPool

IIS 5.1 and earlier: This object is not available.

Controls the status of individual application pools.

IIsApplicationPools

IIS 5.1 and earlier: This object is not available.

Manages application pools.

IIsCertMapper (ADSI)

Maps certificates to Microsoft ® Windows ® accounts.

IIsCompressionSchemes (ADSI)

Establishes global settings for HTTP 1.1 compression schemes.

IIsCompressionScheme (ADSI)

Establishes settings for individual compression schemes.

IIsComputer (ADSI)

Establishes global settings for IIS configuration.

IIsCustomLogModule (ADSI)

Sets properties for custom logging information field nodes.

IIsFilter (ADSI)

Provides information about a specific filter.

IIsFilters (ADSI)

Manages filters.

IIsFtpInfo (ADSI)

Establishes configuration properties for FTP servers in addition to those set at IIsFtpService.

IIsFtpServer (ADSI)

Establishes configuration properties for a single FTP server.

IIsFtpService (ADSI)

Establishes configuration properties common to all FTP servers.

IIsFtpVirtualDir (ADSI)

Sets properties for an individual FTP virtual directory.

IIsIPSecurity (ADSI)

Sets access permissions by IP address and domain address.

IIsLogModule (ADSI)

Contains information about a specific logging module.

IIsLogModules (ADSI)

Maintains information about installed logging modules.

IIsMimeMap (ADSI)

Manages Multipurpose Internet Mail Extensions (MIME) mappings.

IIsMimeType (ADSI)

Manipulates the list of valid MIME types.

IIsWebDirectory (ADSI)

Sets properties for an individual Web directory.

IIsWebFile (ADSI)

Sets properties for an individual Web file.

IIsWebInfo (ADSI)

Establishes configuration properties for Web servers in addition to those set at IIsWebService.

IIsWebServer (ADSI)

Establishes configuration properties for a single Web server.

IIsWebService (ADSI)

Establishes configuration properties common to all Web servers.

IIsWebVirtualDir (ADSI)

Sets properties for an individual Web virtual directory.

 

 

 

Set objW3svc = GetObject("IIS://localhost/w3svc")

For Each objChildObject In objW3svc
 ' Wscript.Echo objChildObject.Name
Next

'Set WebSite = objW3svc.GetObject("IIsWebService", "localhost/w3svc")

Set  WebServer = objW3svc.GetObject("IIsWebServer", 2)
Wscript.Echo WebServer.Name
'WebServer.Stop '停止

Set vdir= WebServer.GetObject("IIsWebVirtualDir", "ROOT")
Wscript.Echo vdir.Name

Set vfile= vdir.GetObject("IIsWebFile", "default.aspx")
Wscript.Echo vfile.Name

posted @ 2009-03-24 13:41  ahuo  阅读(551)  评论(0编辑  收藏  举报