Implement the add code for the ISAPI filter through AppCmd.exe

  • 2020-05-09 19:40:02
  • OfStack

To add an ISAPI filter, use the following syntax:

appcmd set config /section:isapiFilters /+[name=' string ',path=' string ',enabled='true |false',enableCache='true |false',preCondition=' string ']

The variable name string is the name of the ISAPI filter to add. The variable path string is the physical path of the ISAPI filter's.dll file.

In addition, you can specify the values of the following optional properties: enabled, enableCache, and preCondition. By default, the enabled property is true, and the enableCache property is false, with no preconditions. If you want to disable the ISAPI filter, you can specify false for enabled. If the ISAPI filter is to be cached in a friendly manner into HTTP.sys, true can be performed for the enableCache attribute if the filter does not conditionally re-route the URL of/default.htm to/default-1.htm or/default-2.htm. Finally, if the ISAPI filter has certain running conditions set, you can add some preconditions, such as bitness32, which specifies that the ISAPI filter can only run in 32-bit worker processes.

For example, to add the premise that you can only run in a 32-bit worker process and that the.dll file is located in the ISAPI filter ResponseFilter in the.NET Framework 2.0 directory, type the following command at the command prompt, and then press Enter:

appcmd set config /section:isapiFilters /+[name=' ResponseFilter ',path='%windir%/Microsoft.NET/Framework/v2.0.50727/responseFilter .dll',preCondition='bitness32' ]

IIS 7 provides a new command-line tool, Appcmd.exe, that you can use to configure and query objects on the Web server and return output in text or XML format. Here are some examples of tasks you can do using Appcmd.exe:
The & # 8226; Create and configure sites, applications, application pools, and virtual directories.

The & # 8226; Stop and start the site.

The & # 8226; Start, stop, and recycle the application pool.

The & # 8226; View information about worker processes and requests running on the Web server.

Appcmd.exe provides one-step commands for common query and configuration tasks, thereby reducing the complexity of learning the grammar. For example, you can use the list command to search for information about objects, such as applications, or you can use the add command to create objects, such as sites.
Alternatively, you can combine commands in 1 to return more complex data related to objects on the Web server, or to perform more complex tasks. For example, you can accomplish a complex task like stopping all sites with requests that take more than 610 seconds to run.

Related articles: