DefaultDocumentSection Class [IIS 7 and higher]
Specifies the Web page file names to serve to clients by default.
Syntax
class DefaultDocumentSection : ConfigurationSectionWithCollection
Methods
The following table lists the methods exposed by the DefaultDocumentSection class.
Name |
Description |
---|---|
(Inherited from ConfigurationSectionWithCollection.) |
|
(Inherited from ConfigurationSectionWithCollection.) |
|
(Inherited from ConfigurationSectionWithCollection.) |
|
(Inherited from ConfigurationSection.) |
|
(Inherited from ConfigurationSection.) |
|
(Inherited from ConfigurationSectionWithCollection.) |
|
(Inherited from ConfigurationSection.) |
|
(Inherited from ConfigurationSection.) |
|
(Inherited from ConfigurationSection.) |
Properties
The following table lists the properties exposed by the DefaultDocumentSection class.
Name |
Description |
---|---|
Enabled |
A read/write boolean value. true if the files specified in the Files property are returned to clients by default; otherwise, false. The default is true. |
Files |
A FileSettings value that contains the names of the files that the Web server may return to clients by default. |
Location |
(Inherited from ConfigurationSection.) A key property. |
Path |
(Inherited from ConfigurationSection.) A key property. |
SectionInformation |
(Inherited from ConfigurationSection.) |
Subclasses
This class contains no subclasses.
Remarks
This class corresponds to the <defaultDocument> section in ApplicationHost.config.
Example
The following example lists the default documents for the default Web site.
' Connect to the WMI WebAdministration namespace.
Set objWMIService = GetObject("winmgmts:root\WebAdministration")
' Get the default Web site.
Set oSite = objWMIService.Get("Site.Name='Default Web Site'")
' Retrieve the default document section by using the GetSection method.
oSite.GetSection "DefaultDocumentSection", oDefaultDocumentSection
' List the path and show whether the default document section is enabled.
WScript.Echo "Path: " & oDefaultDocumentSection.Path
WScript.Echo
WScript.Echo "Default Document Section Enabled: " & oDefaultDocumentSection.Enabled
WScript.Echo
' List the default document file names.
WScript.Echo "[Default Document File List]"
For Each oFile In oDefaultDocumentSection.Files.Files
WScript.Echo oFile.Value
Next
Inheritance Hierarchy
ConfigurationSectionWithCollection
DefaultDocumentSection
Requirements
Type |
Description |
---|---|
Client |
Requires IIS 7 on Windows Vista. |
Server |
Requires IIS 7 on Windows Server 2008. |
Product |
IIS 7 |
MOF file |
WebAdministration.mof |
See Also
Reference
ConfigurationSectionWithCollection Class [IIS 7 and higher]