Datasheet

Set oBinding = oService.Get(“BindingElement”).SpawnInstance_
oBinding.BindingInformation = “*:80:”
oBinding.Protocol = “http”
oService.Get(“Site”).Create
“MyNewSite”, array(oBinding), “C:\inetpub\MyNewSite”
oService.Get(“Application”).Create _
“/”, “MyNewSite”, “C:\inetpub\MyNewSite”
The WMI provider for IIS 7.0 must be specifically installed, and Microsoft provides a set of WMI tools
that can be downloaded from Microsoft.com.
Diagnostics
IIS 7.0 makes diagnostic tracing and server state management easy. Okay, it really makes it possible,
since the diagnostic functions in IIS 7.0 didn’t exist in previous versions. Run-time status can now be
determined through a new set of APIs that expose the run-time state of sites, applications, and applica-
tion pools, as well as allow for control of those states, through both WMI and managed code. The new
Request Tracing module allows for tracing any request through the pipeline to the point of exit or fail-
ure, and provides a logging function for those traces.
Run-Time State and Control API
The Run-Time State and Control API allows for the determination of a point-in-time status of the server,
site, or application, and the requests being processed. The API exposes the
HttpRequest object in the
worker process, as well as the application domain, and allows better tracing of a hung process and its
cause. Within the
HttpRequest, you can pull the pipeline state and current module the request is in, as
well as details about the request such as the host name and IP address, client IP address, and URL
requested. Runtime state information about running application pools, currently processing requests,
and other exposed information is available from within the IIS Manager GUI, through the command line
appcmd.exe tool and also programmatically through WMI and .NET management classes.
Request Tracing
Using the request tracing module, you can configure logging and tracing of any type of content or result
code. Like most IIS settings, request tracing can be configured at the server, site, or application level.
Configuring request tracing is a simple task. First, you define a trace condition, such as File Not Found
(result code 404) errors. Conditions can be based on result codes or the time taken for the request, or
both. For example, a result code of 200 would only log a trace for a successful request. Once the trace
condition is defined, you choose which trace provider to use and then begin logging traces that meet
these conditions. Traces show in the log, where each step of the request is time stamped and you can see
exactly what happened at each point in the request pipeline, as shown in Figure 1-6. Chapter 20,
“Diagnostics and Troubleshooting,” contains more information on request tracing.
Compatibility
IIS 7.0 has maintained compatibility with IIS 6.0 for easy migration of existing web sites. All existing
ISAPI filters, classic ASP and ASP.NET applications, and ADSI or WMI scripts will work in exactly the
same way they did with IIS 6.0. This is handled through two primary means. Firstly, IIS 7.0 has a Classic
mode application pool setting that allows an application pool to function in the same way that it did in
23
Chapter 1: Background on IIS and New Features in IIS 7.0
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 23