title | description | ms.date | ms.assetid |
---|---|---|---|
ModuleAction Class |
Describes the ModuleAction class and provides the class' syntax, properties, remarks, examples, inheritance hierarchy, and requirements. |
10/07/2016 |
e00dbe6b-a97e-60a7-dd05-f4710e692b87 |
Represents a module entry in the <modules>
section of a configuration file.
class ModuleAction : CollectionElement
This class contains no methods.
The following table lists the properties exposed by the ModuleAction
class.
Name | Description |
---|---|
Name |
A required unique read/write string value that contains the name of the module. The key property. |
PreCondition |
A read/write string value that contains a comma-delimited list of values that represent preconditions for the module to be loaded. The possible values are listed later in the Remarks section. |
Type |
A read/write string value that specifies a managed module's type. |
This class contains no subclasses.
Instances of this class are contained in the Modules
property of the ModulesSection class.
The following table lists the possible values for the PreCondition
property. The integratedMode
and ISAPIMode
settings are mutually exclusive. The default is null
.
Value | Description |
---|---|
bitness32 |
IIS loads the module in a 32-bit worker process. This setting applies only to 64-bit operating systems. |
bitness64 |
IIS loads the module in a 64-bit worker process. This setting applies only to 64-bit operating systems. |
integratedMode |
IIS loads the module only for application pools that run in integrated mode. |
ISAPIMode |
IIS loads the module only for application pools that run in ISAPI mode. |
runtimeVersion |
IIS loads the module only for application pools that use the specified [!INCLUDEdnprdnshort] version. To enable this precondition, append a string in the format vMajorVersion.MinorVersion to the string "runtimeVersion" (for example, "runtimeVersionv2.0"). |
managedHandler |
IIS loads the module only if the request is mapped to a managed handler. This setting can optimize performance by preventing static files from using managed modules for every request. |
The following example adds a managed module to the root Web.config file.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the modules section.
Set oModulesSection = _
oWebAdmin.Get("ModulesSection.Path=" & _
"'MACHINE/WEBROOT/APPHOST/Default Web Site',Location=''")
' Get the ModuleAction class.
Set oModuleAction = oWebAdmin.Get( "ModuleAction" )
' Spawn a new instance of the ModuleAction class.
Set oNewModule = oModuleAction.SpawnInstance_
' Assign values to the new module's Name and Type properties.
oNewModule.Name = "myNewModule2"
oNewModule.Type = "System.Web.Profile.ProfileModule2"
' Call the ModulesSection.Add method to add the new module.
' If the module entry already exists, the error "Cannot create a file
' when that file already exists." will be displayed.
oModulesSection.Add "Modules", oNewModule
' Alert user when done.
WScript.Echo "Done!"
ModuleAction
Type | Description |
---|---|
Client | - [!INCLUDEiis70] on [!INCLUDEwinvista] - [!INCLUDEiis75] on [!INCLUDEwin7] - [!INCLUDEiis80] on [!INCLUDEwin8] - [!INCLUDEiis100] on [!INCLUDEwin10] |
Server | - [!INCLUDEiis70] on [!INCLUDEwinsrv2008] - [!INCLUDEiis75] on [!INCLUDEwinsrv2008r2] - [!INCLUDEiis80] on [!INCLUDEwinsrv2012] - [!INCLUDEiis85] on [!INCLUDEwinsrv2012r2] - [!INCLUDEiis100] on [!INCLUDEwinsrv2016] |
Product | - [!INCLUDEiis70], [!INCLUDEiis75], [!INCLUDEiis80], [!INCLUDEiis85], [!INCLUDEiis100] |
MOF file | WebAdministration.mof |
CollectionElement Class
GlobalModuleElement Class
GlobalModulesSection Class
ModulesSection Class