SiteContainsConfigurationSection Class1
Provides a relationship between a Web site and its configuration sections.
Syntax
class SiteContainsConfigurationSection : ObjectConfigurationAssociation
Methods
This class contains no methods.
Properties
The following table lists the properties for the SiteContainsConfigurationSection
class.
Name | Description |
---|---|
Container |
A read-only Site object that represents an IIS Web site. |
Element |
A read-only ConfigurationSection object that exposes the configuration section for a Web site. |
Subclasses
This class has no subclasses.
Remarks
Associations return only instances of the object that are defined at the level of the object. For example, if the <authentication>
section is the only section defined in the Web.config file at the site level, only the AuthenticationSection instance of the ConfigurationSection
object will be returned.
To get all available sections, you should use the GetAllSections method of the ConfiguredObject class.
Example
The following example lists all configuration sections that are defined at the Web.config level for the default Web site.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
' List the configuration sections present in the Web.config file
' of the default Web site.
Set oSections = oSite.Associators_("SiteContainsConfigurationSection")
For Each oSection In oSections
WScript.Echo oSection.Path_.Class
Next
Inheritance Hierarchy
ObjectConfigurationAssociation
SiteContainsConfigurationSection
Requirements
Type | Description |
---|---|
Client | - IIS 7.0 on Windows Vista - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
Server | - IIS 7.0 on Windows Server 2008 - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF file | WebAdministration.mof |
See Also
ConfiguredObject.GetAllSections Method
ObjectConfigurationAssociation Class
Site Class
VirtualDirectoryContainsConfigurationSection Class