Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Specifies override-mode and control-locking settings for a configuration section.
Syntax
class SectionInformation : EmbeddedObject  
Methods
This class contains no methods.
Properties
The following table lists the properties exposed by the SectionInformation class.
| Name | Description | 
|---|---|
| EffectiveOverrideMode | A read-only stringvalue that specifies whether the current configuration section can effectively override its inherited settings. The possible values are listed later in the Remarks section.To determine the value of EffectiveOverrideMode, IIS traverses up the inheritance hierarchy of configuration sections from the current section. It successively examines theOverrideModeproperty of each parent section until it reaches theoverrideModeDefaultattribute in the section schema definition. IIS calculates theEffectiveOverrideModeby logically combining the values that it encounters and considering their hierarchical ranking. Note:overrideModeDefaultis an optional attribute that contains the default lockdown state of a configuration section. TheoverrideModeDefaultattribute for each configuration section is located in the corresponding section definition under<configSections>in the ApplicationHost.config file. IfoverrideModeDefaultis missing, its value is "Allow". If "Allow" is specified, lower level Web.config files can override settings for the section; if "Deny" is specified, they cannot. TheoverrideModeDefaultdefault for most IIS Web server sections is "Deny". The default for most ASP.NET and .NET Framework sections is "Allow", because these sections contain application-level settings. TheoverrideModeDefaultattribute has no corresponding property in WMI. If you have appropriate permissions, you can edit the ApplicationHost.config file directly or access it programatically by using XML parsing or file access APIs. | 
| IsLocked | A read-only booleanvalue.trueif the current configuration section and its child elements cannot be modified; otherwise,false. | 
| LockItem | A read/write booleanvalue.trueif the current configuration section and its child elements are locked; otherwise,false. The default isfalse. Note:  Although the default isfalse, this property will returnnullwhen it is initially read. If you explicitly set this initial value tofalse, the property will still returnnull. However, if you set the initial value totrue, the property will returntrue; if you then set the value tofalse, the property will explicitly returnfalse. This behavior is due to a limitation in the WMI provider. | 
| OverrideMode | A read/write stringvalue that specifies whether lower level configuration files can override the settings in the current configuration section. The possible values are listed later in the Remarks section. | 
Subclasses
This class contains no subclasses.
Remarks
Instances of this class are contained in the SectionInformation property of the ConfigurationSection class. All configuration section classes inherit the SectionInformation class as one of their properties.
The following table lists the possible values for the EffectiveOverrideMode property.
| Keyword | Description | 
|---|---|
| Allow | Lower level configuration files can override the settings in the current configuration section. | 
| Deny | Lower level configuration files cannot override the settings in the current configuration section. | 
The following table lists the possible values for the OverrideMode property. The default is "Inherit".
| Keyword | Description | 
|---|---|
| Inherit | Lower level configuration files can or cannot override the settings in the current configuration section, depending on the combination of OverrideModevalues that they inherit. | 
| Allow | Lower level configuration files can override the settings in the current configuration section. | 
| Deny | Lower level configuration files cannot override the settings in the current configuration section. | 
Note
The EffectiveOverrideMode property is useful in determining what the effective override mode for a configuration section is when the OverrideMode property is set to "Inherit".
Example
The following example retrieves the SectionInformation properties for all configuration sections.
' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Retrieve configuration sections.  
Set oConfigSections = oWebAdmin.ExecQuery( _  
    "SELECT * FROM ConfigurationSection")  
  
' Loop through the configuration sections.  
For Each oConfigSection In oConfigSections  
    iCounter = iCounter + 1  
  
    ' Display the name of each configuration section and its location.  
    WScript.Echo "[" & iCounter & "] " & oConfigSection.Path_.Class  
    WScript.Echo "Location: " & oConfigSection.Location  
  
    ' Display the SectionInformation property values.  
    Set oConfigSectionInfo = oConfigSection.SectionInformation  
    WScript.Echo "Effective Override Mode: " & _  
        oConfigSectionInfo.EffectiveOverrideMode  
    WScript.Echo "Is Locked: " & oConfigSectionInfo.IsLocked  
    WScript.Echo "Is Present: " & oConfigSectionInfo.IsPresent          
    WScript.Echo "Lock Item: " & oConfigSectionInfo.LockItem              
    WScript.Echo "Override Mode: " & oConfigSectionInfo.OverrideMode  
    WScript.Echo "------------------------------------------"  
Next  
  
Inheritance Hierarchy
SectionInformation
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 |