Add a Wildcard Script Map (IIS 7)
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
Add a wildcard script map when you want to configure an ISAPI extension to intercept every request before the request is sent to its mapped handler.
For example, you might have a handler that performs custom authentication and authorization against a database. You can configure a wildcard script map for the handler to intercept all requests to your application, and make sure that users are authenticated and authorized before they are served the requested page.
After you add a wildcard script map, you must add the executable to the ISAPI and CGI Restrictions list to enable it to run. For more information about ISAPI and CGI restrictions, see Configuring ISAPI and CGI Restrictions in IIS 7.
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 Handler Mappings Feature Requirements (IIS 7).
Exceptions to feature requirements
To add a wildcard script map
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.
To use the UI
To add a wildcard script map, use the following syntax:
appcmd set config /section:handlers /+[name='string',path='string',verb='string',modules="IsapiModule",scriptProcessor='string',resourceType='File | Directory | Either | Unspecified',requireAccess="None | Read | Write | Script | Execute"]
The variable **name **string is the name of the native handler, and path string is the file name extension or file name that the handler processes; for wildcard script maps, the value is *. The variable verb string is the HTTP verb or list of HTTP verbs to which to restrict the handler, such as GET, HEAD, POST, DEBUG; for wildcard script maps, the value is *. The variable scriptProcessor string is the physical path of the .dll file for the handler. The variable resourceType defines the resource to which the mapping applies; for wildcard script maps, the value is Unspecified. The variable requireAccess defines the type of access that the handler requires to run in a virtual directory; for wildcard script maps, the value is None.
For example, to add a wildcard script map for a native handler named CustomAuth, type the following at the command prompt, and then press ENTER:
appcmd set config /section:handlers /+[name='CustomAuth',path='*',verb='*',modules='IsapiModule',scriptProcessor='C:\Handlers\CustomAuth.dll',resourceType='Unspecified',requireAccess='None']
For more information about Appcmd.exe, see Appcmd.exe (IIS 7).
The procedure in this topic affects the following configuration elements:
For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.
Use the following WMI classes, methods, or properties to perform this procedure:
HandlersSection class (IIS)
HttpHandlersSection 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.