GlobalModulesSection Class

Exposes configuration settings for IIS global modules.

Syntax

class GlobalModulesSection : ConfigurationSectionWithCollection  

Methods

The following table lists the methods exposed by the GlobalModulesSection class.

Name Description
Add (Inherited from ConfigurationSectionWithCollection.)
Clear (Inherited from ConfigurationSectionWithCollection.)
Get (Inherited from ConfigurationSectionWithCollection.)
GetAllowDefinition (Inherited from ConfigurationSection.)
GetAllowLocation (Inherited from ConfigurationSection.)
Remove (Inherited from ConfigurationSectionWithCollection.)
RevertToParent (Inherited from ConfigurationSection.)
SetAllowDefinition (Inherited from ConfigurationSection.)
SetAllowLocation (Inherited from ConfigurationSection.)

Properties

The following table lists the properties exposed by the GlobalModulesSection class.

Name Description
GlobalModules An array of GlobalModuleElement objects.
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

The <globalModules> section in the ApplicationHost.config file specifies the native modules at the server level. You can enable these modules by adding their names to the <modules> section at the desired configuration level in ApplicationHost.config or in a Web.config file. In WMI, you can do this by using the Add method of the ModulesSection class.

Example

The following example lists the modules in the <globalModules> section.

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the ApplicationHost.config <globalModules> section.  
Set oSection = oWebAdmin.Get( _  
    "GlobalModulesSection.Path=" & _  
    "'MACHINE/WEBROOT/APPHOST/',Location=''")  
  
' Display the path.  
WScript.Echo  
WScript.Echo "Path: " & oSection.Path  
WScript.Echo  
  
' Display the global modules.  
WScript.Echo "Global Modules"  
WScript.Echo "--------------"  
For Each oGMElement In oSection.GlobalModules  
     WScript.Echo "Module: " & oGMElement.Name  
     WScript.Echo "Image: " & oGMElement.Image  
     WScript.Echo "PreCondition: " & oGMElement.PreCondition  
     WScript.Echo  
Next  

Inheritance Hierarchy

ConfigurationSection

ConfigurationSectionWithCollection

GlobalModulesSection

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

ConfigurationSection Class
ConfigurationSectionWithCollection Class
GlobalModuleElement Class
ModulesSection Class