Export (0) Print
Expand All
Expand Minimize

GlobalModulesSection Class [IIS 7 and higher]

IIS 7.0

Exposes configuration settings for IIS global modules.

class GlobalModulesSection : ConfigurationSectionWithCollection

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.)

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.)

This class contains no subclasses.

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.

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

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

Community Additions

ADD
Show:
© 2015 Microsoft