Add a Managed Module (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

You might have to add a managed module if an application on your Web server requires the behavior supported by the module. When you add a module, you are not creating the module; instead, you are associating code that already exists on the computer together with the Web application that is running on that computer.

Note

The Modules page lists both managed and native modules used by an application. This list might be a subset of all native and managed modules present on the Web server.

Prerequisites

For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Managed Modules Feature Requirements (IIS 7).

Exceptions to feature requirements

  • None

To add a managed module

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.

User Interface

To use the UI

  1. Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).

  2. In Features View, on the server, site, or applicationHome page, double-click Modules.

  3. On the Modules page, in the Actions pane, click Add Managed Module.

  4. In the Add Managed Module dialog box, in the Name box, type a name for the managed module.

  5. In the Type box, select a managed type or type a managed type.

  6. Select the check box to start the module for requests to managed applications or managed handlers if you want the module to respond only to managed requests.

  7. Click OK.

Command Line

To add a managed module at the server level, use the following syntax:

**appcmd add module /name:**string **/type:**string **/preCondition:**string

The variable namestring is the name of the managed module that you want to add at the server level. The variable typestring is managed type for the module. Optionally, specify a condition or conditions under which the module will run by including the variable preConditionstring. For example, to add a managed module named FormsAuthentication with a managed type of System.Web.Security.FormsAuthenticationModule and a precondition to run only for requests to managed content, type the following at the command prompt, and then press ENTER:

appcmd add module /name:FormsAuthentication /type:System.Web.Security.FormsAuthenticationModule /preCondition:managedHandler

When you want to add a managed module to a site or an application, include the virtual path of the site's root application or to an application in a site by specifying a value for the app.name attribute. For example, to add the same managed module as in the previous example to the Default Web Site, type the following at the command prompt, and then press ENTER:

appcmd add module /name:FormsAuthentication /type:System.Web.Security.FormsAuthenticationModule /preCondition:managedHandler /app.name:"Default Web Site/"

Note

When you want to add a managed module to a site's root application, make sure that you include the "/" after the name of the site. In addition, if your site name has spaces, enclose the whole string in quotation marks.

For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

Configuration

The procedure in this topic affects the following configuration elements:

<modules>

For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.

WMI

Use the following WMI classes, methods, or properties to perform this procedure:

  • MdoulesSection class (IIS)

  • HttpModulesSection class (ASP.NET)

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

See Also

Concepts

Configuring Managed Modules (IIS 7)
Configuring Modules in IIS 7