You can also create FRT rules by using command line
utilities such as Appcmd, Windows PowerShell, and Windows Management
Instrumentation (WMI). The Appcmd syntax is as follows.
%systemroot%\system32\inetsrv\AppCmd configure trace "URL" /enable [/path:path] [/statuscodes:code][/timeTaken:timeSpan] [/areas:areas] [/verbosity:detailLevel]
To delete an FRT rule, you can use the following Appcmd syntax.
%systemroot%\system32\inetsrv\AppCmd configure trace "URL" /disable [/path:path]
Don’t forget that for
the rules to take effect, the Web site must have FRT enabled. You can do
this in IIS Manager as described earlier in this chapter, or use Appcmd
as follows, where WebSiteName is the name of the Web site. Similarly, use /disablesite to disable FRT for a Web site.
%systemroot%\system32\inetsrv\AppCmd configure trace "WebSiteName" /enablesite
The parameters to these commands are explained in Table 1.
Table 1. Parameters for Appcmd to Configure FRTParameter | Description |
---|
URL | The URL that you want to trace. | path | The type of content you want to trace. Must be *, *.aspx, *.asp, or custom. If omitted, uses “*” by default. | statuscodes | The status code that you want to trace. If omitted, uses “500,400,401,403” by default. | timeTaken | A
duration in seconds for response times beyond which a request is
considered to have failed. If omitted, 1 minute is the default. | areas | The
list of providers and subareas that you want to enable for the trace
rule. This is based on the providers that are registered in the
configuration—by default, it can contain the ASP, ASPNET, ISAPI, or WWW
Server providers. If ASP.NET is installed, you can further specify
Infrastructure, Module, Page, or AppServices. If WWW Server, you can
further specify Authentication, Security, Filter, StaticFile, CGI,
Compression, Cache, RequestNotifications, IISGeneral, or All. If not
specified, traces all registered providers and their subareas. | verbosity | The
level of detail you want IIS 7.0 to report. Must be General, Critical
Errors, Errors, Warnings, Information, or Verbose. If not specified,
Verbose is used as the default. |
|