ASP
ASP
ActiveX
Data Objects (ADO).
? Processing Transactions: Outlines how IIS and Component Services, available with Windows
2000 or later, work together to provide Web-based transactions.
? Security Ramifications for IIS Applications: Introduces the issues Web developers face when
accessing and providing secure data.
? Development Technologies: Reviews some of the more recent Web technologies, such as XML
and Dynamic HTML.
? Developing Scalable Web Applications: Describes the impact that Web application design
decisions can have on server performance.
? Building Components for ASP: Reviews the development cycle for building components to be
used by ASP.
? Developing ISAPI Extensions and Filters: Describes the Internet Server API (ISAPI) within the
IIS architecture, and provides guidelines for developing ISAPI extensions and filters.
Web Applications: An Overview
This is preliminary documentation for IIS 5.0 and is subject to change.
Open Internet standards have changed the architecture of distributed computing forever. The basic
language of the Web, HTML, has become a popular language for representing the elements of the user
interface. Cross-platform support for scripting languages and Java applets, as well as support for
embedded COM components, makes it possible to combine dynamic elements with static text for a
more interactive user experience. Web technologies aren't solely for use on the Internet, however. They
have been adapted for use by businesses to:
? Create an environment for component-based development.
? Enable distribution of applications throughout an enterprise.
? Create and customize new applications quickly.
? Update databases remotely by using an ordinary Web browser.
? Add transaction processing to Web applications.
? Provide business-to-business information sharing.
? Manage resources and enable remote system administration.
This section outlines general concepts that will assist you in building Web applications, such as the
following:
? Building on the Client/Server Architecture: Briefly outlines the history of the traditional client/server
design model.
? The New System Design: Introduces n-tier and distributed systems design, as an enhancement to
the client/server model.
? Microsoft Windows Distributed interNet Application Architecture: Outlines Microsoft Windows
DNA, the Microsoft architecture for building Web applications.
? Internet Information Services Architecture: Reviews the IIS components and programming model.
Building on the Client/Server Architecture
Active Server Pages Guide Page 87 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
Before delving into the details of building a Web-based application, it might be helpful to review the
architectural model of the Web, and the roles of the browser and server in that model.
Typically, cooperating applications can be categorized as either a client or a server. The client application
requests services and data from the server, and the server application responds to client requests. Early
two-tier (client/server) applications were developed to access large databases, and incorporated the
rules used to manipulate the data with the user interface into the client application. The server's task was
simply to process as many requests for data storage and retrieval as possible.
Two-tier applications perform many of the functions of stand-alone systems: They present a user
interface, gather and process user input, perform the requested processing, and report the status of the
request. This sequence of commands can be repeated as many times as necessary. Because servers
provide only access to the data, the client uses its local resources to perform most of the processing. The
client application must contain information about where the data resides and how it is organized in the
database. Once the data has been retrieved, the client is responsible for formatting and displaying it to the
user.
One major advantage of the client/server model was that by allowing multiple users to simultaneously
access the same application data, updates from one computer were instantly made available to all
computers that had access to the server. However, as the number of clients increased, the server would
quickly become overwhelmed with client requests. Also, because much of the processing logic was tied
to a monolithic suite of applications, changes in business rules led to expensive and time-consuming
alterations to source code. Although the ease and flexibility of two-tier products continue to drive many
small-scale business applications, the need for faster data access and more rapid developmental timelines
has persuaded systems developers to seek out a new way of creating distributed applications.
The New System Design
This is preliminary documentation for IIS 5.0 and is subject to change.
Today's client/server applications resemble their ancestors so little that they have been given a new name,
the multi-tier application, also known as n-tier architecture. In this model, processing is distributed
between the client and the server, and business logic is captured in a middle tier. Most systems will
perform the following three main tasks, which correspond to three tiers, or layers, of the n-tier model:
Task Description
User interface and
navigation
Labeled Tier 1 in the following graphic, this layer comprises the entire user
experience. Not only does this layer provide a graphical interface so that users
can interact with the application, input data, and view the results of requests, it
also manages the manipulation and formatting of data once it arrives at the client.
In Web applications, the browser performs the tasks of this layer.
Active Server Pages Guide Page 88 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The three-tier architecture isolates each major piece of functionality. The presentation is independent of
the processing rules and business logic, which in turn is separate from the data. This model requires much
more analysis and design up front, but greatly reduces maintenance costs and increases functional
flexibility in the long run. The following diagram depicts the Microsoft technologies that service the
various tiers in the new system design.
Microsoft Windows Distributed interNet
Application Architecture
This is preliminary documentation for IIS 5.0 and is subject to change.
Microsoft developed the Windows Distributed interNet Application Architecture (Windows DNA) as a
way to fully integrate the Web with the n-tier model of development. Windows DNA defines a
framework for delivering solutions that meet the demanding requirements of corporate computing, the
Internet, intranets, and global electronic commerce, while reducing overall development and deployment
costs.
Windows DNA architecture employs standard Windows-based services to address the requirements of
Business logic Tier 2, between the interface and data services layers, is the domain of the
distributed application developer. Business logic, which captures the rules that
govern application processing, connects the user at one end with the data at the
other. The functions that the rules govern closely mimic everyday business tasks,
and can be a single task, or a series of tasks.
Data services Shown as Tier 3 in the following graphic, data services are provided by a
structured (SQL, Oracle database) or unstructured store (Microsoft
Exchange, Microsoft
security services
? Microsoft
Message Queue Services
? Microsoft Data Access Components
Microsoft built Windows DNA using open protocols and public interfaces, making it easy for
organizations to integrate third-party products. In addition, by supporting industry-defined standards for
Internet computing, Windows DNA will make it easier for developers to respond to technology changes.
Some of the technologies recently added to the Windows DNA are outlined in the Development
Technologies section. The following diagram illustrates these technologies.
Internet Information Services Architecture
Active Server Pages Guide Page 90 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
IIS is an integral part of the Windows DNA architecture. An important role of IIS is to link clients
accessing the system through the Hypertext Transfer Protocol (HTTP) to the other Windows DNA
services, such as DHTML, ASP, and so on. In addition, IIS includes a basic set of functionality that
systems developers can extend to define a customized application architecture.
This section contains:
? IIS Core Functionality: Describes the basic functionality that you can use to build Web
applications.
? IIS and Component Services: Outlines the functionality used to isolate, manage and coordinate
processing for transactional ASP applications.
? IIS Request Processing: Describes the evaluation procedure used to determine a request type.
The topics in this section describe this basic functionality, and define the relationship of IIS architecture to
the rest of the Windows DNA architecture. A general outline of how IIS processes HTTP requests is
also provided.
IIS Core Functionality
This is preliminary documentation for IIS 5.0 and is subject to change.
IIS defines a basic functionality that you can use to build Web applications. Active Server Pages (ASP)
and other Microsoft technologies have extended this basic functionality to create a rich environment for
application development. The basic server functionality is exposed through the Internet Server
Application Programmer Interface (ISAPI). ISAPI is described in detail in the Developing ISAPI
Extensions section.
The core functions which IIS provides include:
Active Server Pages Guide Page 91 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? Establishing and maintaining HTTP connections.
? Reading HTTP requests and writing HTTP responses.
? Modifying HTTP headers.
? Obtaining client certificate information.
? Managing asynchronous connections.
? Mapping Uniform Resource Locators (URLs) to physical paths.
? Managing and running applications.
? Transmitting files.
ASP extends this functionality by providing a link to the COM architecture and thus the other participants
in Windows DNA. Similarly, you can extend the IIS architecture by defining a custom set of functions
using ISAPI. The relationship between the IIS core functionality, ASP, and extended architectures is
depicted in the following graphic:
IIS and Component Services
This is preliminary documentation for IIS 5.0 and is subject to change.
IIS and Component Services work together to form a basic architecture for building Web applications.
IIS uses the functionality provided by Component Services to:
? Isolate applications into distinct processes.
? Manage communication between COM components (including the ASP built-in objects).
? Coordinate transaction processing for transactional ASP applications.
NoteIn IIS version4.0, Microsoft Transaction Server (MTS) provided transaction support. In IIS5.0,
and Windows2000, Component Services provides all the transaction support of MTS, in addition to a
number of other component development and deployment features.
IIS defines Web applications as a collection of resource files that are grouped into a logical namespace.
By grouping resources into applications you gain the ability to share data throughout the namespace and
to run the application in an isolated process.
Active Server Pages Guide Page 92 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Internally, IIS coordinates isolated applications through an object known as the Web Application
Manager. This object includes a public interface (IWAMAdmin) that you can use to create programs
for administering Web applications. When you run a Web application in an isolated process, IIS uses
Component Services to coordinate concurrent access to resources and pass context information
between COM components.
IIS uses the Component Services ObjectContext object to give COM components that are called by
ASP access to the ASP built-in objects. For example, if you were building a COM component in Visual
Basic that needed to access a form submission from an HTML file, you could use the following code:
Dim objObjectContext As ObjectContext
Dim vntIn As Variant
Set objObjectContext = GetObjectContext ()
vntIn = objObjectContext.Item("Request").Form("Field1")
Component Services uses ObjectContext to maintain information about a particular instance of a COM
component. When IIS compiles the ASP script, it calls Component Services to create an
ObjectContext for tracking information about the ASP script. The ObjectContext includes an identity
property that uniquely identifies instance of the ASP script. For example, if your ASP script creates
instances of COM components that have been registered with Component Services, each of these
objects will be associated with the ASP script's ObjectContext. Similarly, when you create a
transactional ASP script with the @Transaction directive, Component Services is notified and a new
transaction is started. From that point onwards, Component Services will coordinate the updating of any
resources that are under its control. Component Services guarantees the transaction's integrity by
tracking any changes made to persisted resources.
NoteIn IIS version 4.0, transaction support was provided by Microsoft Transaction Server (MTS).
For IIS5.0, and Windows2000, Component Services provides all the transaction support of MTS, in
addition to a number of other features.
For further information on isolating and managing applications, see Defining Application Boundaries.
For further information on transaction processing, see Processing Transactions, Understanding
Transactions.
IIS Request Processing
This is preliminary documentation for IIS 5.0 and is subject to change.
When IIS receives an HTTP request, it evaluates the URL to determine if the request is for static content
(HTML), or dynamic content (ASP or ISAPI).
Request Processing Actions
Active Server Pages Guide Page 93 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Design Decisions
This is preliminary documentation for IIS 5.0 and is subject to change.
Although there is a rich and continually expanding set of tools for Web application development, the
basic development cycle is similar to developing desktop applications in many respects. This section
focuses on design decisions that are unique to Web applications.
This section contains:
? Defining Application Boundaries: Describes the necessary steps needed to assemble you ASP
pages into a single Web application.
? Controlling Application Flow: Outlines the issues to keep in mind when designing how you will
control the flow of Web applications.
? Accommodating International Clients: Contains information relating to the localization of your Web
site into various languages.
Defining Application Boundaries
This is preliminary documentation for IIS 5.0 and is subject to change.
An ASP-based application is a collection of ASP pages and COM components. When you define an
application, you use the Internet Information Services snap-in to designate the application's starting-point
directory in your Web site. Every file and folder under the starting-point directory in your Web site is
considered part of the application . Therefore, you can use the directory structure to form application
boundaries that define the scope of an application. You can have more than one application per Web
Request Action
HTML Page IIS returns the page immediately in HTML format.
ISAPI extension IIS loads the ISAPI DLL (if it is not already running) and
the request is sent to the extension through the
Extension_Control_Block data structure.
File name extension mapped to a
particular ISAPI extension
IIS loads the appropriate DLL file and presents the request
through the Extension_Control_Block data structure.
The .asp extension, for example, is mapped to Asp.dll, so
that all requests for files with an .asp extension will be
directed to Asp.dll.
CGI application IIS creates a new process. IIS will then provide the query
string and other parameters that are included with the
request through the environment and standard input
(STDIN) handle for the process.
Active Server Pages Guide Page 94 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
site, and each application can be configured differently.
One of the most important tasks you face in developing your Web application is to determine how to
assemble your ASP pages into a single Web application. IIS uses the concept of a namespace to
identify applications. A namespace is a way of associating an area of memory with an easily recognized
name; it identifies a group of files as belonging together. IIS uses virtual directories to define namespaces
for applications. The following diagram illustrates this concept.
Scripts and ISAPI extension DLLs within an application boundary form a unit of isolation, which always
runs in a single server process. IIS administrators can either run applications in the same server process
as IIS, a pooled process (the default process), or they can isolate the application by running it in an
isolated process, which is particularly helpful during development and testing.
See Simplify Development With Process Isolation to learn more about isolating applications and
components.
In addition to running applications in a single process, you can also separate your components from .asp
files that call them, by running them in an isolated or pooled process. An isolated process would be a
good configuration for debugging your components. A pooled process provides superior protection for
the server without the overhead involved in maintaining a large number of isolated processes. To run your
components in their own process, you must create a new application and add your components to it with
the Component Services Manager.
Five possible configurations for applications are:
1. Put all .asp files and components in the same process as IIS; this configuration provides the fastest
performance.
2. Put all .asp files and components in one process and IIS in an another process.
3. Put all .asp files and components in a pooled process, IIS in another process, and special
applications in an isolated process.
4. Put all .asp files and IIS in one process, and components in another process.
5. Put all .asp files in one process, components in another process, and IIS in a third process.
Because process boundaries represent different areas of memory, calling between them requires some
extra work by IIS. The mechanism for calling across process boundaries is known as marshaling.
Marshaled calls are slower than calls within a single process. Pooled and isolated applications, therefore,
do not perform as well as applications sharing the IIS process.
Simplify Development With Process Isolation
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 95 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
In earlier versions of IIS, all ISAPI applications (including ASP) shared the resources and memory of the
server process. Although this provided fast performance, unstable components could cause the server to
crashnot an acceptable behavior for a mission-critical application such as IIS. To make matters worse,
in-process components couldn't be unloaded unless the server was restartedwhich meant that
modifying existing components would affect all sites that shared the same server, whether they were
directly affected by the upgrade or not.
Thanks to close integration with Component Services, applications in IIS version 4.0 and above can be
started in an isolated process. There are two reasons for doing this:
1. Component development; rather than taking down the entire server to update a single component,
you can stop and restart just a single application. In earlier versions of IIS, to add an updated
component to an application, or an entirely new application, you previously had to stop the Web
service, replace the old DLL with your new version in its shared location on the server, and restart
the Web service again. Now with an isolated process, you can update a production Web site
without shutting down all applications.
2. Process isolation, which limits the effects of a crash to the single application that caused it. In
addition to protecting your primary Web service from the crash, the application can be configured
to restart automatically as often as you like. In the case of an application fatal error, the
application's process is automatically terminated. Because the application is running in the
Component Services system process, all transactions in progress are aborted. The Windows
event log stores a record of the event, and Component Services restarts the application. The only
clients affected by the failure are those with outstanding requests to that specific application.
Process Isolation
If you decide to run your application as a separate process, or with other applications in a single pooled
process, you will need to select High (Isolated) or Medium (Pooled) from the Application
Protection drop-down list on the Home Directory or Virtual Directory property sheet. You should
first create an application for your application starting-point directory, if you haven't already done so.
Components that will run in the new process must be installed into the appropriate COM application.
For more information, see the Component Services documentation.
Out-of-Process Components
This is preliminary documentation for IIS 5.0 and is subject to change.
Note that out-of-process applications are different from out-of-process components, which are
executables that are run in a separate process. When Server.CreateObject is used to launch an
executable, the following error may occur:
Server object error 'ASP 0196'
Cannot launch out of process component
/HR/report.asp, line 16
This error is the result of a safety mechanism in ASP that prevents the unauthorized launching of
executables from within ASP. Not all executables are safe to use on the server, and may pose security
risks as well. Because in-process components are faster, more secure, and can be hosted by Component
Active Server Pages Guide Page 96 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Services, they are much better suited for server-side use.
If you want to enable the use of out-of-process components for testing and development purposes, you
must first set the AspAllowOutOfProcComponents metabase property to TRUE. This metabase
setting is accessible on both the IIsWebService and the IIsWebVirtualDir IIS Admin Objects.
? Take note that if you set the AspAllowOutOfProcComponents property to TRUE on the
IIsWebService object, all in-process applications will be able to launch executables from script.
An in-process application is a directory that has been marked as an application starting point, by
having the Low (IIS Process) or Medium (Pooled) option selected.
? If you set the AspAllowOutOfProcComponents property to TRUE on the IIsWebVirtualDir
object, and the application is marked to run in separate memory space (out of process), only the
affected application is allowed to launch executables from script. If the application is set to run in
process, the setting will have no effect.
The following ASP code demonstrates the steps required for setting the
AspAllowOutOfProcComponents parameter on the IIsWebService IIS Admin Object.
NoteThe user must have adequate permission to modify the metabase. If you attempt to modify the
metabase from an ASP script without sufficient privileges, you will encounter an error. In order to modify
the metabase from script, you must first log on as a user with administrative rights.
<%
' Get the IIsWebService Admin object.
Set objWebService = GetObject("IIS://LocalHost/w3svc")
' Enable AspAllowOutOfProcComponents.
objWebService.Put "AspAllowOutOfProcComponents", True
' Save the changed value to the metabase.
objWebService.SetInfo
%>
ImportantYou will need to restart the Web service after making this change.
For more information about setting metabase properties using the IIS Admin Objects, see Using IIS
Admin Objects.
Security Considerations for Out-of-Process Applications
This is preliminary documentation for IIS 5.0 and is subject to change.
By default, out-of-process applications and components, including ISAPI extensions, are not able to
access metabase properties. This restriction is primarily for security reasons, to prevent unauthorized
changes to the metabase. If you want to allow out-of-process applications to access the metabase, you
must do one of the following:
? Give the IWAM_machinename account access to the metabase (this is probably a bad idea,
from a system security standpoint).
? Change the identity of the out-of-process COM application from the interactive user
Active Server Pages Guide Page 97 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
(IUSR_machinename, by default) to a specific user account, and give that account access to the
metabase (this is also somewhat risky, but the risk is limited to a single application).
For more information on changing application identity, see the Component Services documentation in the
Platform SDK.
Controlling Application Flow
This is preliminary documentation for IIS 5.0 and is subject to change.
One of the primary choices of any application design is the pattern of execution. In a well-designed
application, the logic of converting inputs to outputs by using modular processing units is obvious. The
COM architecture and Active Server Pages (ASP) address this need for modular design to control the
flow of execution in the Windows DNA architecture.
This section outlines some of the more important issues to keep in mind when designing how you will
control the flow of your Web application. The topics included are:
? Application Control Techniques: Describes the different ways to affect the general flow of
execution.
? Coordinating Client/Server Processing: Outlines the design goals when you distribute processing
between the client and server.
Application Control Techniques
This is preliminary documentation for IIS 5.0 and is subject to change.
ASP provides six different ways to affect the general flow of execution. These six methods are depicted
in the following diagrams. The arrows in the diagrams represent the flow of execution.
Redirecting
Redirection is the process of diverting a request to another location. Redirecting requires a new request
to be sent to the server. However, in general, you should design your application to minimize the amount
of communication between the client and server. Many design problems that have been addressed by
redirecting in the past can now be accomplished by transferring, which does not initiate a new request.
See Coordinating Client/Server Processing for more information on this aspect of application design.
You can accomplish redirecting by using the Response.Redirect method.
Active Server Pages Guide Page 98 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Transferring
The ability to transfer a request from one ASP page to another is introduced in IIS5.0. Transferring is
similar to redirecting; however, it does not require that a new request be initiated. This is a much more
efficient way to control application flow. If you transfer the request to an ASP page outside of the
application boundary, the boundary will be temporarily extended to include the external ASP page. The
external ASP page will behave as if it were included within the application boundary of the calling ASP
page. Therefore, any objects or variables that have been given application scope will still be available in
the ASP page to which you have transferred. In addition to being faster than redirecting, transferring
preserves all of the ASP built-in objects from the original request, including form values from an HTTP
post.
You can accomplish transferring by using the Server.Transfer method.
Executing
The ability to execute a particular ASP script and return the result is introduced in IIS5.0. Executing is
similar to a procedure call in most programming languages. This method of application flow control is
appropriate if you have developed an ASP application that accomplishes some function that you want to
incorporate, but have not built that function into a component.
You can accomplish executing by using the Server.Execute method.
Component Invocation
This is probably the most common way to control the flow of an application. The COM programming
model is integral to the Windows DNA, and should address the vast majority of design problems. Script
Active Server Pages Guide Page 99 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Components, a technology supported in IIS5.0, make it easier to take existing scripts and convert them
to components.
You can accomplish component invocation by using the Server.CreateObject method. For more
information on script components, see Windows Script Components and Using Components and
Objects.
Exiting
Under normal circumstances you will want your ASP application to complete each line of script in the
page. There may be some circumstances, however, where you will need to simply end the response. For
example, if you have detected (by using the Response.IsClientConnected method) that the client is no
longer waiting for a response, you will want to terminate the ASP application.
You can accomplish exiting the ASP by using the Response.End method.
Procedural Processing
If you want to define subroutines or functions within your .asp file, you can do so by using the procedure
syntax that is appropriate for the scripting language you are using. For example, VBScript defines
subroutines with the Sub End Sub syntax and functions with the Function End Function syntax.
JScript, on the other hand, supports procedural processing through function calls. For more information
on subroutine processing, see Writing Procedures.
Coordinating Client/Server Processing
This is preliminary documentation for IIS 5.0 and is subject to change.
Web applications are, by their very nature, distributed. As clients increase their processing capability, the
degree to which you can distribute processing between the client and server increases. By distributing
some of the processing to the client you will increase your application's responsiveness. Distribution of
processing, however, also increases the complexity of your application design.
Active Server Pages Guide Page 100 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
You should keep in mind two design goals when you distribute processing between the client and server.
First, you want to minimize communication across the HTTP connection. Regardless how fast the
connection you have established is, local processing will always be faster. You should pass information
between the client and server only when absolutely necessary.
A second design goal is to expose only those server resources to the client that are absolutely necessary
to accomplish the processing task. Each request from the client should be fully qualified so that the server
does not have to respond to the client for further information and thereby increase roundtrips across the
HTTP connection. For example, if a client can completely describe its capabilities to the server when it
makes a request, the server can immediately send a response that matches those capabilities rather than
requesting further information from the client. This design concept can also be applied to the design of
Web applications that support database access. For example, if a client is checking the status of an
order, you should provide the client with a recordset that describes only that particular order, rather than
all the records in the orders table.
? Caching Data: Introduces a technique that you can use to minimize communication across the
HTTP connection.
? Client Capabilities: Describes functionality provides you with a design tool to help make client
requests fully qualified.
? Remote Data Binding with Remote Data Service: Explains a technique that you can use to limit
client access to appropriate data resources.
Caching Data
This is preliminary documentation for IIS 5.0 and is subject to change.
When clients access your ASP page, there are basically two ways to provide them with the information
they need:
? Your ASP page can either obtain information from server resources, such as from data that has
been persisted to a database, or
? Your ASP page can obtain information from within the application.
Retrieving data from a resource outside the application will require more processing steps, and will
therefore require more time than generating the data from within the application space.
If the data you are going to send to the browser has already been prepared by a previous request, your
application will be able to retrieve that data faster if you store it in a cache. This form of caching is called
output caching. Output caching is particularly suitable when you expect to return the same data in the
same format for many different requests. For example, one common task for developing an input form is
to gather persisted data as members of a drop-down list box. This is preferable to writing the entries
directly into the HTML page, because updates to the persisted data will automatically be reflected in the
form.
The following script is an example of output caching. In this example, the getSportsListBox function
creates a list box from persisted data. The list box is added to the application space so that clients can
access it more quickly than they could if they populated the list box on an individual basis. The example
assumes that a Data Source Name (DSN) called "Sports" is defined on the server.
Active Server Pages Guide Page 101 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%@ LANGUAGE=JavaScript %><HTML><BODY>
<FORM METHOD=post>
What is your favorite sport? <%= getSportsListBox() %>
<P>
<INPUT TYPE=submit>
</FORM>
</BODY>
</HTML>
<%
function getSportsListBox()
{
SportsListBox = Application("SportsListBox")
If (SportsListBox != null) return SportsListBox;
crlf = String.fromCharCode(13, 10)
SportsListBox = "<select name=Sports>" + crlf;
SQL = "SELECT SportName FROM Sports ORDER BY SportName";
cnnSports = Server.CreateObject("ADODB.Connection");
cnnSports.Open("Sports", "WebUser", "WebPassword");
rstSports = cnnSports.Execute(SQL);
fldSportName = rstSports("SportName");
While (!rstSports.EOF)
{ SportsListBox = SportsListBox + " <option>" + fldSportName + "</option>" + crlf; rstSports.MoveNext(); }
SportsListBox = SportsListBox + "</select>"
Application("SportsListBox") = SportsListBox
return SportsListBox;
}
%>
In some circumstances, your application will receive many different requests for the same data, but you
will need to change the presentation of that data for each request. In that case, you use input caching.
With input caching you save the data, but not the presentation of it. You accomplish this by caching the
data with a Dictionary object provided by VBScript, or with an ADO recordset.
The following example demonstrates caching data by adding a connectionless recordset to your
application. ASP scripts within the application space can then access the recordset rather than retrieve
the data from the database. The following two ASP scripts demonstrate this technique.
Excerpt from Global.asa:
<OBJECT ID=rsCustomers PROGID="ADODB.Recordset" RUNAT="Server" SCOPE="Application">
</OBJECT><!--METADATA TYPE="TypeLib" FILE = "C:\Program Files\Common Files\system\ado\msado15.dll"
-->
<% SQL = "SELECT CompanyName, City FROM Customers" Cnn = "DSN=AdvWorks" rsCustomers.CursorLocation = adUseClient rsCustomers.Open SQL, Cnn, adOpenStatic, AdLockReadOnly rsCustomers.ActiveConnection = Nothing
Set myCustomers = Application("rsCustomers").Clone Set CompanyName = myCustomers("CompanyName") Set City = myCustomers("City")
Do Until myCustomers.EOF%><B><%= CompanyName %></B> is located in <B><%= City %></B>.<P>
<%
myCustomers.MoveNext
Loop
%>
Active Server Pages Guide Page 102 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The application's Global.asa file creates the recordset and adds it to the application space. The ASP
script then populates the recordset and makes it connectionless by setting the ActiveConnection
property to Nothing. The ASP script then clones this recordset and iterates through its values, which is
much faster than accessing the database itself. This technique is appropriate only if you know that the
data that will be used to populate the recordset is relatively stable.
Client Capabilities
This is preliminary documentation for IIS 5.0 and is subject to change.
One of the more significant design decisions you will make is how your application will handle differing
client capabilities. For example, one of the most important issues for users is the speed of the connection.
If your application can determine this speed, it can adjust the response to match that capacity. The only
way for your application to be aware of the current connection speed is if the client includes this
information as part of its request.
You can solve the client capabilities problem on either the client side or server side. The client-side
solution relies on Dynamic HTML (DHTML) to include a description of the client's current configuration
as part of the request, as depicted in the graphic below.
The benefits of this approach include:
? Reduction in roundtrips between the client and server.
? Reduced load on the server.
? Improved application responsiveness due to proxy server caching technology.
There are some situations where client-side scripting will not be feasible. For example, applications that
are exposed on the Internet cannot guarantee that the client will support scripting, which means the
applications may fail for some clients. In addition, server-side resources may not be accessible from the
client side, as the client may reside on a network that does not allow scripting for security reasons.
The server-side approach relies on the Browser Capabilities component. This component reads the User
Agent HTTP header included with the request to determine the client's capabilities. The version of the
Browser Capabilities component that shipped with IIS 3.0 and 4.0 determined client capabilities by
looking them up in a static list. The following graphic shows the sequence of events.
Active Server Pages Guide Page 103 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This approach presented difficulties for application designers when the list became out of date. More
importantly, this technique did not cover configurable aspects of a client's capabilities and did not provide
a means of what was actually enabled at the time the request was made.
In IIS 5.0 the Browser Capabilities component has been improved to overcome these earlier design
limitations. The Browser Capabilities component can now be modified for an individual request by the
client returning a cookie describing its capabilities. In addition, if the initial request for an .asp file does
not include a cookie, you can call back to a script that will run on the client to create the cookie. The
following illustration shows the sequence of events.
This improvement to the Browser Capabilities component creates another alternative to the server-side
solution. This technique uses a special status code to call back to the client when a request comes in that
does not include a cookie. You can generate this status code by placing a special meta tag as the first line
in your .asp file. For example:
<!-- METADATA TYPE="Cookie" NAME="BrowsCap" SRC="sendcook.htm" -->
instructs IIS to send the special status codean HTTP 449 status codeto Internet Explorer 5.0; it
then tells Internet Explorer 5.0 to run the script in Sendcook.htm, which will generate a cookie describing
the client capabilities. When the server receives this cookie, it will use the cookie in conjunction with the
Browser Capabilities component to determine how to send the response back to the client.
ImportantIf the METADATA meta tag exists in a file that is requested by the client as a result of a
redirection using the Server.Transfer or Server.Execute methods, IIS will ignore the meta tag.
METADATA meta tags in the file that actually contains the redirect, however, will be processed
normally.
For more details on how to use this feature, see Retrieving Browser Capabilities from a Cookie.
For more information on DHTML client capabilities, see the DHTML reference information on the Site
Active Server Pages Guide Page 104 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Builder Network. The SBN home page is at www.microsoft.com/sitebuilder/. For an example of the
new Client Capabilities component functionality, see the Browser Capabilities Component and ASP
Samples.
Accommodating International Clients
This is preliminary documentation for IIS 5.0 and is subject to change.
One of the advantages of distributing information over the Internet or an intranet is that you can create
international Web sites that users can access from different countries. Users can request pages that have
been localized into their own language, which they read in localized browser versions.
When you create a Web site that contains pages in different languages, you may need to convert strings
that are passed between the browser and the Web server, or between an ASP script and a COM
component. If all pages on the Web site are written in the default character set used by the Web server,
ASP does the conversion automatically. If you author pages in different character sets, however, you
need to use ASP commands that specify how the strings should be converted. For example, if your site
contains some pages in one of the Japanese character sets and others in one of the Chinese character
sets, you need to specify which character set ASP should use while processing strings for a particular
page.
ASP also provides commands that support the cultural conventions for different locales, such as the
format used for currency, time, and date. As with the string conversion commands, you need to use the
locale commands only if your scripts do not use the default locale for the Web server. For more
information, see the following topics.
? Setting the Code Page for String Conversions: Includes sample code for converting strings used
by ASP.
? Setting the Locale Identifier: Describes how to change the format used for currency, time, and
date.
Setting the Code Page for String Conversions
This is preliminary documentation for IIS 5.0 and is subject to change.
A code page is an internal table that the operating system uses to map symbols (letters, numerals, and
punctuation characters) to a character number. Different code pages provide support for the character
sets used in different countries. Code pages are referred to by number; for example, code page 932
represents the Japanese character set, and code page 950 represents one of the Chinese character sets.
Active Server Pages, and the script engines it supports, internally use Unicode, a 16-bit fixed-width
character encoding standard. If you author all of your pages in the default code page of the Web server,
ASP automatically converts strings. If your script was not created in the Web server's default code page,
however, you need to specify the code page so that strings are correctly converted as they are passed:
? Between ASP and the script.
Active Server Pages Guide Page 105 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? Between the browser and your script.
? Between COM components and your script.
To specify the code page for an ASP page, use the @ CODEPAGE directive. For example, to set the
code page to Japanese, use the following directive:
<%@ CODEPAGE = 932 %>
As ASP processes the content and script on this page, it uses the code page you have specified to
convert characters from your script's character set into Unicode. For example, the value that refers to the
letter "a" in ANSI will be converted into the different value that refers to the letter "a" in Unicode.
Active Server Pages assumes that strings passed between the Web server and the browser, or between
your script and COM components, are in the same code page you have set for your script. If you need
to specify a different code page, you can set the Session.CodePage property to override the
CODEPAGE setting. For example, you may have authored your script in JIS but need to respond to a
client that is using UTF-8 (two different character encodings for the standard Japanese character set).
Session.CodePage defaults to the value of the @ CODEPAGE directive; setting it overrides the current
CODEPAGE setting. For example, to change the code page to one of the Chinese character sets, use
the following command:
<% Session.CodePage = 950 %>
If you are temporarily changing the code page for a portion of your script, be sure to set
Session.CodePage back to its original value. The following script shows how to temporarily change the
code page:
<!-- Welcome to my home page in Japanese, code page 932 --!>
<%
@CodePage = 932
Session("OriginalCodePage") = Session.CodePage
<!-- Look up name in Chinese, code page 950 --!>
Session.CodePage = 950
Sender = ReadMailHeader("Sender")
Found = FindFriend("Sender")
<!-- Restore the original code page --!>
Session.CodePage = Session("OriginalCodePage")
If Found == TRUE
ReplyWithPersonalizedForm()
Else
ReplyWithBusinessForm()
%>
Setting the Locale Identifier
This is preliminary documentation for IIS 5.0 and is subject to change.
A locale is a set of user preference information related to the user's language. The locale determines how
dates and times are formatted, how items are alphabetically sorted, and how strings are compared. The
Active Server Pages Guide Page 106 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
locale identifier (LCID) is a 32-bit value that uniquely defines a locale. ASP uses the default locale of
the Web server unless you specify a different locale for a particular script.
To set the locale identifier for an ASP page, use the @ LCID directive. For example, to set the locale to
Japanese, use the following locale identifier:
<%@ LCID = 1041 %>
The @ LCID directive tells ASP the locale in which the script was authored. If you need to change the
locale for input to or output from the script, use the Session.LCID property.
The following example demonstrates setting the locale to British English, and using the VBScript
FormatCurrency method to display the value 125 as currency with the symbol:
<%
Session.LCID = 2057
Dim curNumb
curNumb = FormatCurrency(125)
Response.Write (curNumb)
%>
The Session.LCID property defaults to the @ LCID directive setting. Setting the value of
Session.LCID in a script overrides the default setting.
For more information on LCIDs see "International Features" in the "Windows Base Services" section.
Accessing Data with ASP
This is preliminary documentation for IIS 5.0 and is subject to change.
ASP offers the Web developer flexible, easy-to-use, scalable methods to interact with OLE DB
database providers for Internet or intranet applications. Using ASP and the Microsoft Data Access
Components (MDAC) not only means that you can initially develop a solution using Microsoft Access
and scale up to Microsoft SQL Server 6.5, but that you can access any other databases that have OLE
DB providers. With the additional power of Component Services, you can create highly scalable multi-
tier applications that support Web-based transactions.
This section contains:
? ADO Overview: Provides a brief overview of ActiveX
Data Objects.
? Remote Data Binding with Remote Data Service: Gives an introduction to Remote Data Services
and client-side data binding.
ADO Overview
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 107 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ActiveX
Data Objects (ADO) provides a common programming model for any OLE DB data source;
it is essentially a collection of objects that expose the attributes and methods used to communicate with a
data source. ADO uses general OLE DB providers to accesse unique features of specific data sources; it
also uses native OLE DB providers, including a specific OLE DB provider that provides access to Open
Database Connectivity (ODBC) drivers. Designed to replace the need for all other high-level data access
methods, ADO can access relational, Indexed Sequential Access Method (ISAM), or hierarchical
databases, or any type of data sourceas long as there is an ODBC-compliant driver.
ADO's ease of use, speed, and low memory overhead make it ideal for server-side scripting. In fact,
ADO is the recommended technology for data access for ASP applications. ADO can be called directly
from server-side scripts or from business components.
Unlike earlier data access methods, ADO does not require navigation through a hierarchy to create
objects; most ADO objects can be created independently, which allows greater flexibility in reusing
objects in different contexts and reduces memory consumption. ADO also takes advantage of ODBC
3.0 connection pooling for ODBC data sources, and session pooling for OLE DB providers. This
eliminates the need to continuously create new Connection objects for each user, which is very resource
intensive.
What ADO cannot do, however, is provide remote data to the client. Once the data has been retrieved
and sent to the browser, the user cannot easily manipulate it or make changes to it within the client
application. Data operationsincluding filtering and record modificationsmust take place on the
server, where the actual data manipulation objects reside. If your application design requirements include
client manipulation of data, see Remote Data Binding with Remote Data Service.
OLE DB, the foundation of Microsoft's Universal Data Access model, is a set of COM interfaces that
provides a standard way for programs to access data. The way your application uses ADO functionality
will be partially determined by whether or not there is an OLE DB provider for the data. ADO is
designed to work with OLE DB, and in most instances your ADO components will communicate with
databases through OLE DB; you can also use ADO to communicate directly with the ODBC driver, if
no OLE DB provider is available. Using ADO through an OLE DB provider has an impact on the
following areas:
? Using Stored Procedures with ADO: Describes several key issues you should consider when
using stored procedures.
? Choosing the Client Networking Library for ADO:Explains the issues surrounding the selection of
a networking library and it's impact on database access speed.
For more information on ADO, see the ADO SDK . For performance information, see Data Access
Performance. To see examples of using ADO, see Database Connectivity under the ASP Script
Examples in ASP Samples.
Using Stored Procedures with ADO
This is preliminary documentation for IIS 5.0 and is subject to change.
A stored procedure is a precompiled collection of SQL statements and optional control-of-flow
statements stored under a name and processed as a unit. Creating stored procedures with connection
Active Server Pages Guide Page 108 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
pooling enabled can present some special considerations. For example, creating temporary stored
procedures for prepared SQL statements is an option that is configurable from the ODBC Data Source
Administrator. The default for this setting is "On" for the SQL Server 2.65 and 3.5 drivers, which means
that when a SQL statement is prepared, a temporary stored procedure is created and compiled. When
the prepared command is called by one of the ADO methods, the temporary stored procedure is
executed, saving the overhead of parsing and compiling the SQL statement. This feature can improve the
performance of your application, if it is used properly. If your SQL statement is going to be executed
more than twice, or if it will be run more than once and contain parameters, the statement should be
prepared. Keep in mind that to prepare a SQL statement it must be compiled the first time you run it,
and that the preparation is lost once you disconnect from the database.
When connection pooling is enabled, you have to decide when temporary stored procedures should be
deleted. With the SQL Server 2.65 driver, stored procedures will be released when the connection is
released. With the SQL Server 3.5 driver, you have the option of deleting them either when the
connection is released, or as appropriate while connected.
There can be storage problems with temporary stored procedures and connection pooling. If you are
using the default setting, you risk of running out of space in TempDB, where temporary stored
procedures are created and stored. When connection pooling is enabled, a connection is made to the
database, but when the client is finished with it and releases it, the connection goes back into the pool.
The connection is not released and the stored procedures are not deleted from the TempDBeven
though they are no longer associated with a client and will never be called again.
Thus, when running the SQL Server 2.65 driver, it may be advisable to disable the creation of stored
procedures on preparation when connection pooling is enabled. With the SQL Server 3.5 driver, the
option to create temporary stored procedures should be disabled or set to "disconnect and as
appropriate" when running connection pooling. Setting this option to "disconnect and as appropriate"
means that the ODBC SQL Server driver will drop the connection when the OLE DB ICommand
object that created the temporary stored procedure is released. If your client code uses ADO, the stored
procedure would be released when the ADODB.Recordset and ICommand object are closed.
Choosing the Client Networking Library for ADO
This is preliminary documentation for IIS 5.0 and is subject to change.
When ADO communicates with a database it does so through a networking library. Your selection of a
networking library will be determined by the data provider and system configuration, and can have a
significant impact on database access speed. For example, if you are accessing data from a Microsoft
SQL Server database your access speed, in general, will be faster if you use the TCP/IP networking
library. However, if SQL Server is running on the same computer as IIS, you may find some
performance improvements by using the Named Pipes networking library.
You can set the networking library for a DSN by using the Data Sources (ODBC) option in Control
Panel. Once you set a library for one connection, it will become the default library for all subsequent
connections, as well as for any DSN-less connections that your application may use.
NoteIf you change the network library from Named Pipes to TCP/IP, be sure not to remove Named
Pipes as one of the options, because SQL Server Enterprise Manager relies on this library.
Active Server Pages Guide Page 109 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remote Data Binding with Remote Data
Service
This is preliminary documentation for IIS 5.0 and is subject to change.
If your Web application provides clients with the ability to access data, you can distribute the processing
of that data between the client and the server with Remote Data Service (RDS). Client-side RDS
components send queries to the Web server. The server-side RDS components process these requests
and send them to the Database Management System (DBMS) by use of a business object. The DBMS
responds to the request, sending back the data to the Web server. The RDS components on the Web
server transform that data into an ADO Recordset object. The data is parsed for transport to the client
and sent back across the network to the client computer where it may be displayed in data-aware
controls, such as a text or combo box.
The two main objects that you will use to accomplish remote data binding are RDS.DataControl and
RDS.DataFactory. First, create a copy of the RDS.DataControl object on the client computer by
inserting an object tag in an HTML page. For example:
<OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" ID="RDSDC1">
<PARAM NAME="SQL" VALUE="SELECT Author, ID FROM Authors">
<PARAM NAME="CONNECT" VALUE="DSN=Pubs;">
<PARAM NAME="SERVER" VALUE=http://Bookweb/>
</OBJECT>
The preceding object tag creates an instance of the RDS.DataControl object and sets the SQL,
Connect, and Server parameters for it. If you add this tag to an HTML page, you could then bind the
data control object to multiple data-aware controls on the HTML page. For example, the following
HTML tags display an HTML table that is bound to the above RDS.DataControl object.
<TABLE id=Tasks DataSrc=#RDSDC1 WIDTH=100% BORDER=1 style="display: none">
<THEAD ALIGN=left>
<TR>
<TH><em>ID</TH>
<TH><em>Author</TH>
</TR>
</THEAD>
<TR>
<TD><DIV DATAFLD=ID></DIV></TD>
<TD><DIV DATAFLD=Author></DIV></TD>
</TR>
</TABLE>
The object on the server that communicates with the RDS.DataControl object is either the
RDS.DataFactory, or a business component. You can instantiate the RDS.DataFactory object by
first creating a RDS.DataSpace object on the client, which then creates an instance of the
DataFactory object on the server with the CreateObject method. The following example script
demonstrates this process.
If your data access needs cannot be served by the RDS.DataFactory object, you can either a create a
Active Server Pages Guide Page 110 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
custom business component to communicate with the client, or you can use ADO directly from your
ASP script to retrieve the data. In the following example, the custom business component, Inventory,
exposes a method called getQuantityonHand. The RDS.DataControl object creates an instance of
Inventory on the server, and then calls the getQuantityonHand method to retrieve records.
<HTML>
<HEAD>
</HEAD>
<BODY>
<!-- RDS.DataControl -->
<OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" ID=ADC1></OBJECT>
<!-- RDS.DataSpace -->
<OBJECT ID="ADS1" WIDTH=1 HEIGHT=1 CLASSID="CLSID:BD96C556-65A3-11D0-983A-00C04FC29E36">
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
Option Explicit
Sub GetRecords()
Dim objInventory, myRS
Set objInventory =
ADS1.CreateObject("Company.Inventory", _
"http://<%=Request.ServerVariables("SERVER_NAME")%>")
' Inventory exposes a method called
' getQuantityonHand that takes connection string and SQL parameters.
Set myRS = objInventory.getQuantityonHand _
("DSN=pubs;UID=sa;PWD=permission;","Select Quantity From Inventory")
' Assign the returned recordset to SourceRecordset.
ADC1.SourceRecordset = myRS
End Sub
</SCRIPT>
</BODY>
</HTML>
The same issues that are described in Component Design Guidelines, in the IIS documentation in the
Platform SDK, apply to any custom data business components you create to communicate with
RDS.DataControl. For example, you should make sure that the component supports either the
Apartment or Both threading model.
NoteRemote Data Service (RDS) replaces the Advanced Data Connector (ADC), which is now
considered obsolete. In particular, the ADC remoting functionality (the ability to manipulate and modify
sets of records on the client) has been integrated into ADO as RDS.
For more information, see the DAO SDK.
Processing Transactions
This is preliminary documentation for IIS 5.0 and is subject to change.
Transaction processing is an approach to application development that divides all processing into
individual units of work, known as transactions. The integration of IIS and Component Services has
made it easy to create Web applications that support transaction processing. If you are designing a Web
application that will support transaction processing, you will face several basic design decisions. This
section outlines the technology that underlies transactional ASP, as well as some fundamental design
Active Server Pages Guide Page 111 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
issues.
This section contains:
? Designing Transactional Web Applications: Describes the design requirements for transactional
Web applications.
? Transaction Processing Technology: Provides information on Component Services and Message
Queuing Services (MQS).
Designing Transactional Web Applications
This is preliminary documentation for IIS 5.0 and is subject to change.
One of the most important design concepts for transactional Web applications is the distinction between
business processes and physical transactions. Business processes are the day-to-day processes of most
organizations; for example, processing a sales order. A physical transaction corresponds to the actual
updating of the data resources that are used to record the business process. A business process will
usually be made up of more than one physical transaction.
For example, when a sales order is processed, there are at least three distinct steps that need to be
accomplished:
? Verify product availability.
? Obtain payment.
? Commit the order.
Each of these steps could represent one or more physical transactions, depending on the system design.
The connectionless nature of the Internet mandates that steps be broken into distinct physical
transactions. When a physical transaction is begun, all other users will be prevented from updating the
resources that participate in the transaction until the transaction completes. Imagine what would happen if
the entire sales order process described above was grouped into a single physical transaction. A user
could begin a transaction by indicating his or her interest in a product, which would lock the customer's
account and mark the product as no longer available in the inventory database. The customer could then
leave his or her browser running while attending to other business, but before committing to the sale.
Because the entire order has been treated as one physical transaction, all of the resources are locked
until either the customer commits, or your system throws out the order due to a business rule. Such a
design is not feasible for a transaction processing system that is exposed on the Web.
The design requirements for transactional Web applications will probably always be presented in terms
of business processes. It is important, therefore, to establish some design techniques for breaking
business processes into physical transactions. One important technique is to always limit physical
transactions to a single .asp file.
NoteBusiness processes can span multiple .asp files, but physical transactions should not.
Another design technique is the use of status codes within transactional resources to indicate if a
transaction is pending or committed. By including status codes you can reserve a resource without
Active Server Pages Guide Page 112 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
actually committing it. When the business process is complete, you can initiate another physical
transaction that commits all pending resources by changing their status code. The Crawford & Sons
Bicycle Company case study illustrates how these two principles affect the implementation of
transactional Web applications.
The Crawford & Sons Web Application
The Crawford & Sons Custom Bicycle Company is a manufacturer of hand-made bicycles that they
distribute throughout North America. They have decided to begin taking orders for their bicycles through
a Web application. They use Microsoft SQL Server to maintain customer and inventory records and
have already developed data and business-logic components that are registered with Component
Services. Now they need to develop the .asp files that will allow their customers to access these
components within the scope of a single business process. The following diagram illustrates the distinct
physical transactions and the .asp files that make up their Web application design.
The sales order application is made up of four .asp files: Login.asp, Credit.asp, Inventory.asp, and
Commit.asp. Notice that each of the physical transactions is represented by a separate .asp file.
(Each .asp file contains the @Transaction = Required directive.) Login, Credit, and Inventory each
interact with a COM component called Sales Order. Sales Order exposes methods for accomplishing
the three steps of taking an order.
When the customer is ready to commit to the sale (that is, the business process is completed),
Commit.asp groups the entire logical transaction into a single physical transaction which changes all of the
status codes in the data resources from "pending" to "complete." This design accommodates both the
connectionless nature of the Web and the requirement for providing the user with a unified business
process.
For more information on Component Services transactions, see Understanding Transactions . To view
samples of transactional scripting, see ASP Transaction Services in ASP Samples.
Active Server Pages Guide Page 113 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Transaction Processing Technology
This is preliminary documentation for IIS 5.0 and is subject to change.
The primary technology that makes it possible for an ASP to participate in a transaction is Component
Services. Component Services provides IIS with transaction services and an environment for hosting
component instances. One of the benefits of this environment is the ability to create attributes for
individual component instances. When IIS compiles an ASP script, a new instance of the IIS Web
Application Manager (IISWAM) is created. IISWAM is a COM component that IIS uses to manage
applications. If the ASP script contains the @TRANSACTION directive, the instance of IISWAM will
be declared within the transaction environment with an appropriate transaction property. For example, if
you include @TRANSACTION = Required in your ASP script, you are telling Component Services
that the instance of IISWAM that it creates should be run in a transaction. If the ASP script creates
instances of any other components that have been registered with Component Services, Component
Services will treat them as part of the same transaction. The following diagram illustrates the relationship
between ASP and IISWAM.
Component Services provides transaction services to IIS through two different layers. At the lowest
layer, Component Services interacts with the Microsoft Distributed Transaction Coordinator (MS DTC)
to guarantee that transactions meet the ACID properties (Atomic, Consistent, Isolated, Durable) of a
reliable transaction processing system. Component Services links component instances to MS DTC
through two mechanisms: resource managers and resource dispensers. A resource manager is a system
service that manages durable data. Component Services supports resource managers that implement
either the OLE Transactions protocol, such as Microsoft SQL Server 6.5, or the X/Open DTP XA
standard. Resource dispensers are similar to resource managers in that they work with components to
share state information. However, the information they share is not durable. For example, resource
dispensers can manage pools of database connections for components that use standard ODBC
interfaces. The ODBC 3.0 Driver Manager is the resource dispenser for ODBC connections.
For more information on Component Services transactions, see Understanding Transactions . To view
samples of transactional scripting, see ASP Transaction Services in ASP Samples.
Security Ramifications for IIS Applications
This is preliminary documentation for IIS 5.0 and is subject to change.
Securing Web sites is a critical issue for Web developers. It is also one of the most potentially confusing.
Active Server Pages Guide Page 114 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
A secure system requires careful planning, and Web site administrators and programmers must have a
clear understanding of the options for securing their site. In addition, they need to understand how all of
the various security subsystems interact.
This section provides an overview of the security issues faced by ASP, component, and ISAPI
developers.
This section contains:
? Accessing Client Certificates with ASP: Describes the use of server-side scripts to access client
certificates.
? Passing Security Context: Outlines the various security contexts that may play a part in request
processing.
? Additional Security Considerations: Discusses the various issues surrounding security in IIS
applications.
Accessing Client Certificates with ASP
This is preliminary documentation for IIS 5.0 and is subject to change.
With Active Server Pages (ASP), you can create a server-side script that extracts the contents of a
user's client certificate and saves this information in a text file. By adding this script to SSL-secured Web
pages, you can effectively catalog and manage the client certificates of users accessing your server.
For more information see ClientCertificate.
Passing Security Context
This is preliminary documentation for IIS 5.0 and is subject to change.
Windows establishes a security context for each logged on user. When IIS receives a request from a
client, it authenticates the request and then impersonates the client. While IIS is impersonating the client,
IIS operates within the confines of the authenticated client's security context. This security context may
change during the various stages of request processing, depending on the nature of the client request. The
following diagram illustrates the various security contexts that may play a part in request processing.
Active Server Pages Guide Page 115 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The security context of the IIS process (inetinfo) is known as LocalSystem. However, when IIS is
processing a client request, it will impersonate the context of the client that generated the request. If the
client is authenticated with the Anonymous authentication scheme, the security context will be
IUSR_machinename for in process applications and IWAM_machinename for applications running in
an isolated process. If the client is authenticated with any other authentication scheme, the security
context will map to the individual account of the client.
If you create an instance of a COM component with ASP, the COM component will inherit the security
context of the .asp file that created it. When IIS destroys the component instance, it will also use the
security context of the .asp file in most instances. There is at least one case, however, where this will not
occur. If the COM component has been given session scope (that is, Session("mysesscomp") =
Server.CreateObject("MyComps.Comp1")), and the session times out before the component is
destroyed, IIS will try to destroy the component by using its own security context (LocalSystem) rather
than the context of the client that accessed the .asp file. If the component has accessed secured
resources that it has not released, this scenario can have side effects throughout the system.
Additional Security Considerations
This is preliminary documentation for IIS 5.0 and is subject to change.
Registry Issues
Many IIS applications require resources provided by other software components. For instance, an
ISAPI extension DLL may call an Automation server from a third-party software company, or a CGI
application may launch a program built with Microsoft
Visual Basic
Visual Basic
JScript
Directory Services, LDAP, and NDS, while using a single, standard set of
interfaces. ADSI shields the client application from the implementation and operational details of the
underlying data store or protocol.
Active Server Pages Guide Page 119 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
An application called an ADSI provider makes itself available to ADSI client applications. The data
exposed by the provider is organized in a custom namespace, defined by the provider. In addition to
implementing the interfaces defined by ADSI, the provider also can implement the ADSI schema. The
schema is used to provide metadata about the namespace structure and objects that are provided by the
ADSI provider.
For more information about ADSI, refer to the Active Directory Service Interfaces Version2.0 SDK
and the Active Directory Schema SDK in the Platform SDK.
ADSI and IIS
IIS currently stores most Internet site configuration information in a custom data store called the IIS
metabase. IIS exposes a low-level DCOM interface that allows applications to gain access to, and
manipulate, the metabase. To make it easy to access the metabase, IIS also includes an ADSI provider
that wraps most of the functionality provided by the DCOM interface, and exposes it to any ADSI-
compliant client applications. For more information about using ADSI with IIS, see Using IIS Admin
Objects.
Developing Scalable Web Applications
This is preliminary documentation for IIS 5.0 and is subject to change.
Performance
In the world of single-user desktop software development, the performance requirements are clearly
defined. In that context, it is important that the user does not experience a significant delay when
performing common tasks.
In the early years of the World Wide Web, slow Web pages were commonplace, and for many users a
long wait was tolerated. However, as more and more enterprise Web applications were created, the
requirements for Web application performance began to rival those of the single-user desktop. Today,
with faster communication technologies becoming prevalent, users are demanding greater increases in site
performance.
Scalability
The real issue in Web application design is that while the application appears to the single user as a
traditional desktop application, it is actually a distributed application that could be simultaneously
servicing hundreds or even thousands of users.
Web applications demand performance under a wide range of environment conditionsin other words,
they must be scalable. Certainly, Web applications must perform well, but good performance when being
used by a single user does not necessarily translate into scalability.
There are many different metrics for determining how scalable an application is. Ideally, a truly scalable
Web application should be able to:
? Serve a single user as well as it can serve hundreds or thousands of simultaneous users.
Active Server Pages Guide Page 120 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? Perform twice as well when installed on a computer with twice the resources (processors, RAM,
and so on), perform three times as well on a computer with three times the resources, and so on.
Of course, these scalability requirements are ideals. However, the closer your application comes to
fulfilling those ideals, the more successful your application will be when under load.
Design Considerations for Performance and Scalability
The most important thing to keep in mind when beginning a Web application development project is that
Web applications are, for the most part, server applications. Historically, server software has been
second only to operating system internals in complexity and programming difficulty. IIS and Windows
offer a variety of innovative tools that make Web application development much faster and easier, but the
concerns and challenges of server software programming still exist.
Some important considerations for making your application scalable include:
? Technology Choices: As with any development platform, Windows offers a number of options
for completing a given task. Making the correct choice of technologies is the first, and often most
important, step in designing a scalable Web application. For example, if a client-side technology
provides the same or similar functionality as provided on the server, the client-side option often
makes more sense; as the application is more scalable because the client handles much of the
processing load. Proper technology choices can also lead to fewer round-trips between the client
and server, further improving performance. For more information, see Web Applications: An
Overview and the Internet Client SDK.
? Language Choices: Choosing a development language impacts your Web application by defining
the range of users who have access to it. For example, including scripting in an application will
exclude users who have browsers that do not support scripting. The following lists some of the
development languages available:
? Windows Script Components
? Visual Basic
? Java
? C++
? Algorithm and Work Flow Design: Even the proper technology, if used improperly, will yield
poor results.
? Multithreading: IIS and Windows provides a multithreaded environment, and in order to create
scalable applications, you must choose the appropriate threading model for your components.
? Resource Contention and Delay: Resource contention and leakage are often major culprits
behind applications that cannot scale.
? "Real-World" Testing: You must be sure to thoroughly test your Web application in an
environment that approximates the actual environment in which the application will be deployed.
A detailed analysis of all of these topics is beyond the scope of this documentation. Instead, in this
section you will find a compilation of notes and procedures, specific to IIS, that will help you create a
scalable Web application.
This section contains:
? Developing Scalable ASP Applications
? Developing Scalable Components
? Designing High-Performance ISAPI Applications
? Data Access Performance
Active Server Pages Guide Page 121 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? Performance and Scalability Testing
For more information about designing Web applications, see Design Decisions.
Developing Scalable ASP Applications
This is preliminary documentation for IIS 5.0 and is subject to change.
Proper Use of ASP
With ASP, you can easily and quickly create Web applications, in a fraction of the time it would take
with a more conventional server-side language, such as C or C++.
However, the ease with which you can create ASP-based applications belies the complexity of the
server processing and client-server interaction required by that application. It is possible that Web
applications that have been created with extensive ASP scripting will not scale well.
To avoid scalability problems, there are two points to keep in mind when developing with ASP:
? ASP is the "Glue"
? ASP should not be used for business logic
The first point emphasizes that ASP dovetails with HTML, client-side scripting using DHTML, and XML
to create a powerful platform for interacting with the user. ASP scripting was designed to be used to bind
the user interface to the business logic of the Web application, and ASP was optimized for these sorts of
tasks.
The second point should serve as an important reminder: If you find that most of your business logic is
embedded into the ASP, your application will probably not scale properly. It is true that ActiveX
scripting languages, hosted by ASP, are capable of accomplishing a great deal of business logic
processing. However, if the business logic required for your Web application is more than trivial, then
that business logic should be folded into a new COM component, rather than embedded in ASP scripts.
Optimizing ASP on IIS
Once you have established that your use of ASP is appropriate for the design of your application, and
you have encapsulated the bulk of your business logic into COM components, there are two avenues by
which you can further improve the performance and scalability of your Web application:
? ASP Scripting Optimization
? IIS Configuration Optimization
For more information about designing Web applications, see Design Decisions.
ASP Scripting Optimization
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 122 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Code optimization should be performed carefully. In ASP scripting, as in any other programming
language, it is important to determine which areas of the application are consuming the most time and
resources. This information can then be used to efficiently target the critical area for optimization.
Here are several tips that might help minimize performance problems in your ASP scripts:
? Cache Application-scoped objects and data, either by creating the object in Global.asa, or
creating it on-demand in an individual ASP script, and placing it in Application scope.
? Combine output of Response.Write calls by relying on ASP buffering, which is on by default
with IIS5.0. In order to improve the perceived performance of applications that use buffered
output while performing time-consuming operations, however, your application should periodically
use Reponse.Flush to maintain contact with the user.
If ASP buffering has been disabled for your Web application, performance may be improved if
you minimize the number of separate calls to Response.Write by combining separate output
strings into one larger string. However, if you must perform extensive string manipulations to
accomplish this, the gain in performance is probably offset by the time spent processing the strings.
? Use <OBJECT> tags instead of Server.CreateObject, when instantiating objects at
Application or Session scope. The reason is that IIS delays actually instantiating the object
specified by <OBJECT> tags until the object is actually put to use. If you use <OBJECT> tags,
and your script never uses the object, then your application will not instantiate the object. In
contrast, Server.CreateObject forces IIS to immediately create an instance of the object,
whether the object is used by the script or not.
? Use local variables, avoid public variables. Local variables can be accessed quicker by the
ASP scripting engine than public variables, because the entire namespace doesn't have to be
searched to access the value of a local variable.
? Use client-side validation of user input, where possible, to minimize the HTTP round trips
required. If the browser is full-featured, harness the power of the browser, and free up server-side
resources for more critical tasks. Of course, some integrity checking still should be performed on
the server, depending on the application, as an extra precaution against data corruption.
? Copy individual values from collections into local variables, if you are going to reference the
value more than once. This saves ASP from having to perform lookup processing in the collection
for each and every reference.
? Turn off session state for the entire application, if possible. If your application does not
require the use of IIS sessions, you should use the Internet Information Services snap-in to disable
session state for the entire application. Sessions in IIS remain in memory, and the memory
allocated to the sessions will not be freed until the session has been terminated or timed-out. If
your application is being used by many concurrent users, the server's resources could become
depleted, and performance could be affected. If some parts of your application don't need session
state, you should disable session state for those pages by using the @ENABLESESSIONSTATE
directive.
Turning off session state whenever possible is especially helpful if the page contains a
<FRAMESET> element. Some browsers, including Internet Explorer, will use separate threads to
process the separate frames of the frameset. If session state is turned on for the frameset page, the
client-side performance benefit of these parallel threads will be lost, because IIS will be forced to
serialize the threads processing the separate requests.
? If you do rely on session state, avoid placing large amounts of data into the Session
object, and into session state. Sessions in IIS are persistent, and the memory allocated to the
sessions will not be freed until the session has been terminated or timed-out. If your application is
Active Server Pages Guide Page 123 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
being used by many concurrent users, the server's resources could become depleted, and
performance could be affected.
? Do not provide empty Session_OnStart or Session_OnEnd.
? Pay close attention to the effects of IIS and ASP configuration changes. See IIS
Configuration Optimization for more details.
? If your ASP page is running as part of an application, designate the application as out-of-
process for application debugging only. Process isolation, which was introduced in IIS 4.0, is
a useful capability. The cross-process marshalling required to support process isolation, however,
can introduce a certain amount of overhead to ASP processing. This difference in overhead is
most significant for simple ASP pages, and is less of a concern for more complex pages. To
maximize scalability and performance, however, consider running the application out-of-process
only until it is sufficiently debugged and stable to be run in-process with IIS.
? Avoid ReDimming arrays, if possible. It is more efficient to simply allocate the full size of the
array when the array is first initialized.
IIS Configuration Optimization
This is preliminary documentation for IIS 5.0 and is subject to change.
IIS provides several configuration settings that you can adjust to tune the performance and scalability of
your Web applications. These include:
? AppAllowDebugging
? AspAllowSessionState
? AspEnableChunkedEncoding
? AspEnableTypelibCache
? AspProcessorThreadMax
? AspTrackThreadingModel
? AspRequestQueueMax
? AspQueueConnectionTestTime
? AspSessionMax
? AspBufferingOn
? AspScriptEngineCacheMax
? AspSessionTimeout
? AspThreadGateEnabled
Performance tips are provided in the reference page for each property; click a property in preceding list
to see its reference page.
Developing Scalable Components
This is preliminary documentation for IIS 5.0 and is subject to change.
Because you should encapsulate most of your business logic within COM components, it is important
that your components be designed for high performance, in addition to being readily scalable.
Active Server Pages Guide Page 124 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Here are some suggestions for creating scalable components:
? Optimize your algorithms.
? Make your component adhere to the proper threading. Page-scope components should be
use either the Apartment or Both threading model; application-scope components should use the
Both threading model, and should also aggregate the free-threaded marshaller. For more
information about component threading issues, see the topic Selecting a Threading Model in
the IIS documentation in the Platform SDK.
? If your component uses the heap intensively, consider other heap alternatives. Intensive
use of the Windows
Parts
varReturn
A variable that receives the return value from the method.
Method
The object method chosen.
Methods
IIsWebVirtualDir Sets properties for an individual Web virtual
directory.
Constants A list of constants used with IIS Admin Objects.
CreateMapping Maps a certificate to a Windows account.
DeleteMapping Deletes an existing certificate mapping.
GetMapping Retrieves an existing certificate mapping.
SetAcct Sets a new value for the Windows account string
in an existing certificate mapping.
SetEnabled Enables or disables an existing certificate
mapping.
SetName Sets a new value for the name string in an existing
certificate mapping.
Active Server Pages Guide Page 142 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
CreateMapping
This is preliminary documentation for IIS 5.0 and is subject to change.
The CreateMapping method of the IIsCertMapper object maps a certificate to a Windows account.
Syntax
IIsCertMapper.CreateMapping vCert, NtAcct, NtPwd, strName, IEnabled
Parameters
vCert
Contains the certificate. The certificate is either a string or an array of bytes, usually obtained from
the ClientCertificate collection of the built-in ASP Request Object.
NtAcct
Contains the Windows account string.
NtPwd
Contains the password string for NtAcct.
strName
Contains the friendly name for the account.
IEnabled
Specifies TRUE to enable the mapping, FALSE to disable the mapping.
Code Example
<%
Dim CertObj, vCert
vCert = Request.ClientCertificate("CERTIFICATE")
Set CertObj = GetObject("IIS://..path../IIsCertMapper")
CertObj.CreateMapping vCert, "MYACCT", "MYPASS", "My Name", True
%>
See Also
DeleteMapping, GetMapping, SetAcct, SetEnabled, SetName, SetPwd
DeleteMapping
SetPwd Sets a new value for the Windows password
string in an existing certificate mapping.
ADSI Object Methods Standard methods for ADSI objects.
Active Server Pages Guide Page 143 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The DeleteMapping method of the IIsCertMapper object deletes an existing certificate mapping.
Four seek methods are available to search for the mapping: by certificate, by name, by Windows
account, and by numeric string index.
Syntax
IIsCertMapper.DeleteMapping IMethod, vKey
Parameters
IMethod
Specifies the seek method to use for searching the mappings. Valid seek methods are 1, 2, 3, or
4. Seek method 1 specifies search by certificate, seek method 2 searches by name, method 3
searches by Windows account, and method 4 searches by a 1-based numeric string index (for
example "1," "2," and so on).
vKey
Specifies the key to use in the search specified by IMethod. For seek method 1, vKey specifies a
certificate. For seek method 2, vKey specifies a name. For seek method 3, vKey specifies a
Windows account. For seek method 4, vKey specifies a numeric string index (for example, "1,"
"2," and so on).
Code Example
<%
Dim CertObj
Set CertObj = GetObject("IIS://..path../IIsCertMapper")
'Search by Windows account.
CertObj.DeleteMapping 3, "MYACCT"
%>
See Also
CreateMapping, GetMapping, SetAcct, SetEnabled, SetName, SetPwd
GetMapping
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetMapping method of the IIsCertMapper object retrieves a certificate and the mapping data
from an existing certificate mapping. Four seek methods are available to search for the mapping: by
certificate, by name, by Windows account, and by numeric string index. The retrieved mapping is
returned in parameter variables you provide.
Syntax
IIsCertMapper.GetMapping IMethod, vKey, vCert, NtAcct, NtPwd, strName, IEnabled
Active Server Pages Guide Page 144 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Parameters
IMethod
Specifies the seek method to use for searching the mappings. Valid seek methods are 1, 2, 3, or
4. Seek method 1 specifies search by certificate, seek method 2 searches by name, method 3
searches by Windows account, and method 4 searches by a 1-based numeric string index (for
example, "1," "2," and so on).
vKey
Specifies the key to use in the search specified by IMethod. For seek method 1, vKey specifies a
certificate. For seek method 2, vKey specifies a name. For seek method 3, vKey specifies a
Windows account. For seek method 4, vKey specifies a numeric string index (for example, "1,"
"2," and so on).
vCert
Receives the returned certificate.
NtAcct
Receives the returned Windows account.
NtPwd
Receives the returned Windows account password.
strName
Receives the returned Windows account friendly name.
IEnabled
Receives the returned value TRUE for an enabled mapping, or FALSE for a disabled mapping.
Code Example
<%
Dim CertObj, vCert, NtAcct, NtPwd, strName, IEnabled
Set CertObj = GetObject("IIS://..path../IIsCertMapper")
'Search by Windows account.
CertObj.GetMapping 3, "MYACCT", vCert, NtAcct, NtPwd, strName, IEnabled
%>
See Also
CreateMapping, DeleteMapping, SetAcct, SetEnabled, SetName, SetPwd
SetAcct
This is preliminary documentation for IIS 5.0 and is subject to change.
The SetAcct method of the IIsCertMapper object sets a new value for the Windows account string in
an existing certificate mapping. Four seek methods are available to search for the mapping: by certificate,
by name, by Windows account, and by numeric string index.
Syntax
IIsCertMapper.SetAcct IMethod, vKey, NTAcct
Active Server Pages Guide Page 145 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Parameters
IMethod
Specifies the seek method to use for searching the mappings. Valid seek methods are 1, 2, 3, or
4. Seek method 1 specifies search by certificate, seek method 2 searches by name, method 3
searches by Windows account, and method 4 searches by a 1-based numeric string index (for
example, "1," "2," and so on).
vKey
Specifies the key to use in the search specified by IMethod. For seek method 1, vKey specifies a
certificate. For seek method 2, vKey specifies a name. For seek method 3, vKey specifies a
Windows account. For seek method 4, vKey specifies a numeric string index (for example, "1,"
"2," and so on).
NTAcct
Specifies a new value for the Windows account string.
Code Example
<%
Dim CertObj
Set CertObj = GetObject("IIS://..path../IIsCertMapper")
'Search by Windows account.
CertObj.SetAcct 3, "MYACCT", "NewAccount"
%>
See Also
CreateMapping, DeleteMapping, GetMapping, SetEnabled, SetName, SetPwd
SetEnabled
This is preliminary documentation for IIS 5.0 and is subject to change.
The SetEnabled method of the IIsCertMapper object enables or disables an existing certificate
mapping. Four seek methods are available to search for the mapping: by certificate, by name, by
Windows account, and by numeric string index.
Syntax
IIsCertMapper.SetEnabled IMethod, vKey, IEnabled
Parameters
IMethod
Specifies the seek method to use for searching the mappings. Valid seek methods are 1, 2, 3, or
4. Seek method 1 specifies search by certificate, seek method 2 searches by name, method 3
searches by Windows account, and method 4 searches by a 1-based numeric string index (for
Active Server Pages Guide Page 148 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
CreateMapping, DeleteMapping, GetMapping, SetAcct, SetEnabled, SetName
IIsCompressionSchemes
This is preliminary documentationfor IIS 5.0 and is subject to change.
IIsCompressionSchemes is an ADSI container object that contains the individual HTTP 1.1
compression schemes that are available to IIS, represented by the ADSI object
IIsCompressionScheme. In addition, all global compression settings for the IIS installation are stored in
IIsCompressionSchemes.
ADsPath
IIS://MachineName/W3SVC/Filters/Compression/Parameters
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
varReturn = object.Property
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that refers to the IIsCompressionSchemes object, usually as a result of a previous
GetObject operation.
Method or Property
The particular object method or property that you want to use.
Can Contain
Properties
Metabase Properties
IIsCompressionScheme
ADSI Object Properties ADSI Container Object Properties
Active Server Pages Guide Page 149 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Methods
IIsCompressionScheme
This is preliminary documentation for IIS 5.0 and is subject to change.
The IIsCompressionScheme IIS Admin Object is an ADSI object that contains configuration
information about an individual compression scheme. All instances of the IIsCompressionScheme
object are contained within IIsCompressionSchemes.
ADsPath
IIS://MachineName/W3SVC/Filters/Compression/Scheme
where MachineName can be any name, or "LocalHost."
Syntax
varReturn = object.Method
varReturn = object.Property
Parts
varReturn
A variable that receives the return value from the method.
object
HcCacheControlHeader HcIoBufferSize
HcCompressionBufferSize HcMaxDiskSpaceUsage
HcCompressionDirectory HcMaxQueueLength
HcDoDiskSpaceLimiting HcMinFileSizeForComp
HcDoDynamicCompression HcNoCompressionForHttp10
HcDoOnDemandCompression HcNoCompressionForProxies
HcDoStaticCompression HcNoCompressionForRange
HcExpiresHeader HcSendCacheHeaders
HcFilesDeletedPerDiskFree
ADSI Object Methods Standard methods for ADSI objects.
ADSI Container Object Methods Standard methods for ADSI container objects.
Active Server Pages Guide Page 150 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
A variable that refers to the IIsCompressionScheme object, usually as a result of a previous
GetObject operation.
Method or Property
The particular object method or property that you want to use.
Properties
Metabase Properties
Methods
IIsComputer
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsComputer object to set values of global metabase properties that determine how IIS
operates. The IIsComputer object also provides methods to manage metabase backups. You can use
these methods to store multiple backup versions in long-term storage, restore the metabase from a
backup version of your choice, and enumerate and delete backups.
The IIsComputer object is an ADSI container object.
ADsPath
IIS://MachineName
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
ADSI Object Properties
HcCompressionDll HcFileExtensions
HcCreateFlags HcMimeType
HcDoDynamicCompression HcOnDemandCompLevel
HcDoStaticCompression HcPriority
HcDoOnDemandCompression HcScriptFileExtensions
HcDynamicCompressionLevel
ADSI Object Methods Standard methods for ADSI objects.
Active Server Pages Guide Page 151 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsComputer object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Can Contain
Properties
Metabase Properties
Methods
See Also
Backup
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the Backup method of the IIsComputer object to back up the metabase to a location you
specify by providing a backup location name of up to 100 characters in length. Multiple metabase
IIsFtpService IIsMimeMap
IIsLogModules IIsWebService
ADSI Object Properties Standard properties for ADSI objects.
MaxBandwidth MimeMap
MaxBandwidthBlocked
Backup Saves the metabase to long-term storage.
DeleteBackup Deletes a metabase backup from long-term
storage.
EnumBackups Enumerates metabase backups in long-term
storage.
Restore Restores a metabase backup from long-term
storage.
ADSI Object Methods Standard methods for ADSI objects.
ADSI Container Object Methods Standard methods for ADSI container objects.
Active Server Pages Guide Page 152 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
backups can be stored in a backup location.
Syntax
IIsComputer.Backup BackupLocation, BackupVersion, BackupFlags
Parameters
BackupLocation
A string of up to 100 characters that specifies the backup location. The storage mechanism will be
determined by IIS. If an empty string is specified, the backup will be stored in the default location.
BackupVersion
Specifies the version number to be assigned to the backup. Must be less than or equal to
MD_BACKUP_MAX_VERSION. Can be set to one of the following values.
BackupFlags
One or more of the following flags.
Remarks
IIS determines the backup storage mechanism, so the backup location name you provide does not
necessarily translate to a particular directory, file, or database storage mechanism. As implemented in this
release, metabase backups are stored as files in the system32\inetsrv\MetaBack directory.
ImportantThe metabase backup and restore functionality exists for versioning purposes, not for cross-
machine replication. A metabase backup must be restored only to the same machine from which it was
originally created.
Code Example
<%
Dim ComputerObj, iFlags
Set ComputerObj = GetObject("IIS://LocalHost")
'Backup to next available version number.
'Set flags to save the metabase first and
MD_BACKUP_HIGHEST_VERSION Overwrite the highest existing backup version
in the specified backup location.
MD_BACKUP_NEXT_VERSION Use the next backup version number available
in the specified backup location.
MD_BACKUP_FORCE_BACKUP Force the backup even if the SaveData
operation specified by
MD_BACKUP_SAVE_FIRST fails.
MD_BACKUP_OVERWRITE Back up even if a backup of the same name
and version exists in the specified backup
location, overwriting if necessary.
MD_BACKUP_SAVE_FIRST Perform a SaveData operation before the
backup.
Active Server Pages Guide Page 153 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
'force the backup even if save fails.
iFlags = (MD_BACKUP_SAVE_FIRST or MD_BACKUP_FORCE_BACKUP)
ComputerObj.Backup "MyBackups", MD_BACKUP_NEXT_VERSION, iFlags
%>
See Also
DeleteBackup, EnumBackups, Restore
DeleteBackup
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the DeleteBackup method of the IIsComputer object to delete a metabase backup from
a backup location.
Syntax
IIsComputer.DeleteBackup BackupLocation, BackupVersion
Parameters
BackupLocation
A string of up to 100 characters that specifies the backup location. If an empty string is specified,
the backup will be deleted from the default location.
BackupVersion
Specifies the version number of the backup to be deleted from the backup location, or can be the
following constant.
Code Example
<%
Dim ComputerObj
Set ComputerObj = GetObject("IIS://LocalHost")
'Delete version 1 backup.
ComputerObj.DeleteBackup "MyBackups", 1
%>
See Also
Backup, EnumBackups, Restore
EnumBackups
MD_BACKUP_HIGHEST_VERSION Delete the highest existing backup version in
the specified backup location.
Active Server Pages Guide Page 154 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the EnumBackups method of the IIsComputer object to enumerate metabase backups
stored in one or more backup locations, retrieving the location, version number, and date of each
backup.
Syntax
IIsComputer.EnumBackups BkupLocIn, IndexIn, BkupVerOut, BkupLocOut, BkupDateTimeOut
Parameters
BkupLocIn
A string of up to 100 characters that specifies the backup location. If an empty string is specified,
all backup locations will be searched.
IndexIn
Specifies the index of the backup to enumerate. Start the index at 0 and increment by 1 until
MD_ERROR_DATA_NOT_FOUND is returned.
BkupVerOut
Receives the version number of the backup enumerated.
BkupLocOut
Receives the backup location of the backup enumerated.
BkupDateTimeOut
Receives the date and time of the backup, in Universal Time Coordinate (UTC), formerly GMT
(Greenwich Mean Time).
Code Example
<%@ LANGUAGE=VBScript %>
<SCRIPT LANGUAGE = "JScript" RUNAT = SERVER>
var TempDate = new Date();
TempDif = TempDate.getTimezoneOffset();
Session("sTempDif") = TempDif;
</SCRIPT>
<%
Dim CompObj, Index, Version, Location, GMTDate, LocDate, MinDif
MinDif = Session("sTempDif")
On Error Resume Next
Set CompObj = GetObject("IIS://LocalHost")
Index = 0
' Iterate until method returns an error.
Do While True
' Empty location input string means enumerate all locations.
CompObj.EnumBackups "", Index, Version, Location, GMTDate
If Err.Number <> 0 Then
' If error returned, no more backups to enumerate.
Exit Do
End If
Response.Write Version & ", "
Response.Write Location & ", "
Response.Write GMTDate & ", "
' Convert to server local date and time.
LocDate = DateAdd("n", (-MinDif), GMTDate)
Active Server Pages Guide Page 155 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Response.Write "(" & LocDate & ")"
Response.Write "<BR>"
Index = Index + 1
Loop
%>
See Also
Backup, DeleteBackup, Restore
Restore
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the Restore method of the IIsComputer object to restore the metabase from a backup.
The restore operation stops all services dependent on IISADMIN, including all servers, until the restore
has completed, then restarts all services. Because of this, if you are restoring the metabase by using a
script in an ASP page, you must specify a machine name other than the one on which your script is
executing. You cannot use LocalHost as the machine name. You should be careful to plan for this service
interruption when restoring the metabase from a backup.
Syntax
IIsComputer.Restore BackupLocation, BackupVersion, BackupFlags
Parameters
BackupLocation
A string of up to 100 characters that specifies the backup location. If an empty string is specified,
the backup will be retrieved from the default location.
BackupVersion
Specifies the version number of the backup to be restored from the backup location, or can be the
following constant.
BackupFlags
Reserved. Must be zero.
Code Example
<%
Dim ComputerObj, ComputerName
'Restore metabase on a different computer.
ComputerName = "MyOtherComputer"
'You can use LocalHost if running under Windows Script Host.
Set ComputerObj = GetObject("IIS://" & ComputerName)
'Restore the highest number version in MyBackups.
MD_BACKUP_HIGHEST_VERSION Restore from the highest existing backup
version in the specified backup location.
Active Server Pages Guide Page 156 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ComputerObj.Restore "MyBackups", MD_BACKUP_HIGHEST_VERSION, 0
%>
Remarks
You can use the Restore method with LocalHost in scripts running in a command window by using
Cscript.exe. For more information, see the Windows Script Host material in the Windows
documentation.
ImportantThe metabase backup and restore functionality exists for versioning purposes, not for cross-
machine replication. A metabase backup must be restored only to the same machine from which it was
originally created.
See Also
Backup, EnumBackups, DeleteBackup
IIsCustomLogModule
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsCustomLogModule object to configure custom logging information fields. For more
information about custom logging fields, see Setting Metabase Properties for Logging.
ADsPath
IIS://MachineName/Logging/CustomLogging
IIS://MachineName/Logging/CustomLogging/Field
IIS://MachineName/Logging/CustomLogging/FieldGroup
IIS://MachineName/Logging/CustomLogging/FieldGroup/Field
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsComputer object, usually as a result of a previous GetObject
operation.
Method
Active Server Pages Guide Page 157 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The object method chosen.
Properties
Metabase Properties
Methods
IIsFilter
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsFilter object to set metabase properties that affect the operation of ISAPI filters.
You can set filter properties at the Web service level or for an individual Web server.
The IIsFilter object is an ADSI object, but not an ADSI container object.
ADsPath
IIS://MachineName/W3SVC/Filters/FilterName
where MachineName can be any name or "LocalHost."
or
IIS://MachineName/W3SVC/N/Filters/FilterName
where MachineName can be any name or "LocalHost," and N is the number of a Web server.
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
ADSI Object Properties
LogCustomPropertyDataType LogCustomPropertyMask
LogCustomPropertyHeader LogCustomPropertyName
LogCustomPropertyID LogCustomPropertyServicesString
ADSI Object Methods Standard methods for ADSI objects.
Active Server Pages Guide Page 158 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
A variable that contains the IIsFilter object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Properties
Metabase Properties
Methods
IIsFilters
This is preliminary documentation for IIS 5.0 and is subject to change.
The IIsFilters object is an ADSI container object that contains the collection of IIsFilter objects. You
can use the IIsFilters object to set the FilterLoadOrder property to specify the sequence in which
filters are to be loaded, and to enumerate through filters. You can use the IIsFilters object to manage
filters at the Web service level or at an individual Web server.
The IIsFilters object is an ADSI container object.
ADsPath
IIS://MachineName/W3SVC/Filters
where MachineName can be any name or "LocalHost."
ADSI Object Properties
FilterDescription NotifyNonSecurePort
FilterEnabled NotifyOrderHigh
FilterFlags NotifyOrderLow
FilterPath NotifyOrderMedium
FilterState NotifyPreProcHeaders
NotifyAccessDenied NotifyReadRawData
NotifyAuthentication NotifySecurePort
NotifyEndOfNetSession NotifySendRawData
NotifyEndOfRequest NotifySendResponse
NotifyLog NotifyUrlMap
ADSI Object Methods Standard methods for ADSI objects
Active Server Pages Guide Page 159 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
or
IIS://MachineName/W3SVC/N/Filters
where MachineName can be any name or "LocalHost," and N is the number of a Web server.
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsFilters object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Can Contain
Properties
Metabase Properties
Methods
IIsFtpInfo
This is preliminary documentation for IIS 5.0 and is subject to change.
Some metabase properties associated with the FTP service are stored at the Info subkey of the
MSFTPSVC key. You can use the IIsFtpInfo object to set values for these properties.
The IIsFtpInfo object is an ADSI object, but not an ADSI container object.
IIsFilter
ADSI Object Properties
FilterLoadOrder
ADSI Object Methods Standard methods for ADSI objects.
ADSI Container Object Methods Standard methods for ADSI container objects.
Active Server Pages Guide Page 160 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ADsPath
IIS://MachineName/MSFTPSVC/Info
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsFtpInfo object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Properties
Metabase Properties
Methods
IIsFtpServer
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsFtpServer object to set metabase properties that apply to a specific FTP server and
to set inheritable metabase properties for FTP virtual directories. Specific methods are also available to
control server operation. FTP servers are identified in the metabase by their index numbers. The first
FTP server is number 1, the second is number 2, and so on.
The IIsFtpServer object is an ADSI container object. For more information on ADSI container
objects, see ADSI Features.
ADsPath
ADSI Object Properties
LogModuleList
ADSI Object Methods Standard methods for ADSI objects.
Active Server Pages Guide Page 161 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS://MachineName/MSFTPSVC/N
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsFtpServer object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Can Contain
Properties
Metabase Properties
IIsFtpVirtualDir
ADSI Object Properties
A I
AccessFlags ConnectionTimeout
AccessRead DefaultLogonDomain
AccessWrite DisableSocketPooling
AdminACL DontLog
AllowAnonymous ExitMessage
AnonymousOnly FtpDirBrowseShowLongDate
AnonymousPasswordSync GreetingMessage
AnonymousUserName IPSecurity
AnonymousUserPass
Log...
LogAnonymous LogExtFileTimeTaken
Active Server Pages Guide Page 162 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Methods
See Also
LogExtFileBytesRecv LogExtFileUriQuery
LogExtFileBytesSent LogExtFileUriStem
LogExtFileClientIp LogExtFileUserAgent
LogExtFileComputerName LogExtFileUserName
LogExtFileCookie LogExtFileWin32Status
LogExtFileDate LogFileDirectory
LogExtFileFlags LogFileLocaltimeRollover
LogExtFileHttpStatus LogFilePeriod
LogExtFileMethod LogFileTruncateSize
LogExtFileProtocolVersion LogNonAnonymous
LogExtFileReferer LogOdbcDataSource
LogExtFileServerIp LogOdbcPassword
LogExtFileServerPort LogOdbcTableName
LogExtFileSiteName LogOdbcUserName
LogExtFileTime LogPluginClsId
LogType
M S
MaxClientsMessage ServerBindings
MaxConnections ServerComment
MaxEndpointConnections ServerListenBacklog
MSDOSDirOutput ServerListenTimeout
Realm ServerSize
ServerAutoStart ServerState
Continue Resumes the server.
Pause Pauses the server.
Start Starts the server.
Status Retrieves current status of server.
Stop Stops the server.
Active Server Pages Guide Page 163 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Continue
This is preliminary documentation for IIS 5.0 and is subject to change.
The Continue method of the IIsFtpServer object continues the server operation after it has been
paused.
Syntax
IIsFtpServer.Continue
Code Example
<%
Dim ServerObj
'Continue the second FTP server.
Set ServerObj = GetObject("IIS://LocalHost/MSFTPSVC/2")
ServerObj.Continue
%>
See Also
Start, Pause, Stop, Status
Pause
This is preliminary documentation for IIS 5.0 and is subject to change.
The Pause method of the IIsFtpServer object pauses the server operation.
Syntax
IIsFtpServer.Pause
Code Example
<%
Dim ServerObj
'Pause the second FTP server.
Set ServerObj = GetObject("IIS://LocalHost/MSFTPSVC/2")
ServerObj.Pause
ADSI Object Methods Standard methods for ADSI objects.
ADSI Container Object Methods Standard methods for ADSI container objects.
Active Server Pages Guide Page 164 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
%>
See Also
Start, Continue, Stop, Status
Start
This is preliminary documentation for IIS 5.0 and is subject to change.
The Start method of the IIsFtpServer object starts the server operation.
Syntax
IIsFtpServer.Start
Code Example
<%
Dim ServerObj
'Start the second FTP server.
Set ServerObj = GetObject("IIS://LocalHost/MSFTPSVC/2")
ServerObj.Start
%>
See Also
Pause, Continue, Stop, Status
Status
This is preliminary documentation for IIS 5.0 and is subject to change.
The Status method of the IIsFtpServer object returns an integer that indicates the current status of the
server. The possible values are 1 (starting), 2 (started), 3 (stopping), 4 (stopped), 5 (pausing), 6
(paused), or 7 (continuing).
Syntax
IIsFtpServer.Status
See Also
Start, Pause, Continue, Stop
Active Server Pages Guide Page 165 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Stop
This is preliminary documentation for IIS 5.0 and is subject to change.
The Stop method of the IIsFtpServer object stops the server operation.
Syntax
IIsFtpServer.Stop
Code Example
<%
Dim ServerObj
'Stop the second FTP server.
Set ServerObj = GetObject("IIS://LocalHost/MSFTPSVC/2")
ServerObj.Stop
%>
See Also
Start, Pause, Continue, Status
IIsFtpService
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsFtpService object to set the metabase property values that control FTP sites and
FTP virtual directories. The DownlevelAdminInstance property indicates the specific FTP server
instance to administer (for IIS 2.0 Internet Server Manager clients performing remote administration of
IIS 5.0).
The IIsFtpService object is an ADSI container object.
ADsPath
IIS://MachineName/MSFTPSVC
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsFtpVirtualDir object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Can Contain
IIsFtpVirtualDir
Properties
Metabase Properties
Methods
ADSI Object Properties
AccessFlags IPSecurity
AccessRead Path
AccessWrite UNCPassword
DontLog UNCUserName
FtpDirBrowseShowLongDate
Active Server Pages Guide Page 169 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIsIPSecurity
This is preliminary documentation for IIS 5.0 and is subject to change.
The IIsIPSecurity object is a custom ADSI object that you can use to set access permissions by IP
address and domain address.
The IIsIPSecurity Boolean property, GrantByDefault, determines if access by users is granted or
denied by default.
If GrantByDefault is set to TRUE, then all IP addresses and Internet domains are granted access,
except those you specify to be denied. Use IPDeny and DomainDeny to deny access to specific IP
addresses and domains.
NoteIPDeny and DomainDeny are only valid if GrantByDefault is set to TRUE.
If GrantByDefault is set to FALSE, then all IP addresses and domains are denied access by default,
except those you specify to be granted access. Use IPGrant and DomainGrant to grant access to
specific IPs and domains.
NoteIPGrant and DomainGrant are only valid if GrantByDefault is set to FALSE.
ADsPath
For the server's root virtual directory,
IIS://MachineName/W3SVVC/N/ROOT
where MachineName can be any name or "LocalHost."
For a specific virtual directory,
IIS://MachineName/W3SVC/N/ROOT/vdirName
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
ADSI Object Methods Standard methods for ADSI objects
ADSI Container Object Methods Standard methods for ADSI container objects
Active Server Pages Guide Page 170 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
A variable that receives the return value from the method.
object
A variable that contains the IIsIPSecurity object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Valid Locations
IIsIPSecurity Properties
Metabase Properties
Key Type Metabase Path
IIsWebService /LM/W3SVC/
IIsWebServer /LM/W3SVC/1
IIsWebFile /LM/W3SVC/1/ROOT/vdirName/text.htm
IIsWebDirectory /LM/W3SVC/1/ROOT/vdirName/subdirectory
IIsFtpVirtualDir /LM/SMFTPSVC/1/ROOT/vdirName
IIsFtpService /LM/SMFTPSVC/
IIsFtpServer /LM/SMFTPSVC/1
IIsWebVirtualDir /LM/W3SVC/1/ROOT/Samples
IPDeny This method accesses an array of IP addresses
that are not allowed access to the server.
IPGrant This method accesses an array of IP addresses
that are allowed access to the server.
DomainDeny This method accesses an array of domains that
are not allowed access to the server.
DomainGrant This method accesses an array of domains that
are allowed access to the server.
GrantByDefault
NoteThis property is valid only when used in
the context of the IIsIPSecurity object.
This Boolean property determines if access is
granted by default or not. If GrantByDefault is
set to TRUE, then you can use IPDeny and
DomainDeny to deny access by specific IP
addresses and domains. If GrantByDefault is
set to FALSE, then you can use IPGrant and
DomainGrant to grant access by specific IP
addresses and domains.
Active Server Pages Guide Page 171 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IPDeny
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IPDeny property of the IIsIPSecurity object to edit lists of IP addresses, held in an
array, that are not allowed access to the server.
Syntax
SecObj.IPDeny "IPAddress,SubnetMask"
Parameters
SecObj
An IIS Admin Object of type IIsIPSecurity.
IPAddress
This is a specific IP address you want to deny access to the server.
SubnetMask
This is the subnet mask for the specified IP address.
Code Example
<%
Dim SecObj
Dim MyIPSec
Dim IPList, DomainList
Set SecObj = GetObject("IIS://LocalHost/W3SVC/1")
Set MyIPSec = SecObj.IPSecurity
'Test value of MyIPSec.GrantByDefault here.
DomainList = MyIPSec.DomainDeny
IPList = MyIPSec.IPDeny
Redim IPList (Ubound(IPList)+1)
IPList (Ubound(IPList)) = "123.0.0.1,255.255.255.0"
Redim DomainList (Ubound(DomainList)+1)
DomainList (Ubound(DomainList)) = "somedomain.com"
IPSec.DomainDeny = DomainList
IPSec.IPDeny = IPList
Set SecObj.IPSecurity = MyIPSec
DirOjb.Setinfo
%>
ADSI Object Properties A list of properties valid at multiple objects.
IPSecurity This property specifies the IP access restrictions
for a URL. It can be used to grant or deny access
to client browsers based on either their IP address
or DNS host name.
Active Server Pages Guide Page 172 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
IPGrant, DomainDeny, DomainGrant, GrantByDefault, IIsIPSecurity
IPGrant
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IPGrant property of the IIsIPSecurity object to edit lists of IP addresses, in an array,
that are not allowed access to the server.
Syntax
SecObj.IPGrant "IPAddress,SubnetMask"
Parameters
SecObj
An IIS Admin Object of type IIsIPSecurity.
IPAddress
This is a specific IP address you want to grant access to the server.
SubnetMask
This is the subnet mask for the specified IP address.
Code Example
<%
Dim SecObj
Dim MyIPSec
Dim IPList, DomainList
Set SecObj = GetObject("IIS://LocalHost/W3SVC/1")
Set MyIPSec = SecObj.IPSecurity
'Test value of MyIPSec.GrantByDefault here.
DomainList = MyIPSec.DomainGrant
IPList = MyIPSec.IPGrant
Redim IPList (Ubound(IPList)+1)
IPList (Ubound(IPList)) = "123.0.0.1,255.255.255.0"
Redim DomainList (Ubound(DomainList)+1)
DomainList (Ubound(DomainList)) = "somedomain.com"
IPSec.DomainGrant = DomainList
IPSec.IPGrant = IPList
Set SecObj.IPSecurity = MyIPSec
Ojb.Setinfo
%>
See Also
IPDeny, DomainDeny, DomainGrant, GrantByDefault, IIsIPSecurity
Active Server Pages Guide Page 173 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
DomainDeny
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the DomainDeny property of the IIsIPSecurity object to edit lists of domains that are not
allowed access to the server.
Syntax
SecObj.DomainDeny Domain
Parameters
SecObj
An IIS Admin Object of type IIsIPSecurity.
Domain
This is the domain you want denied access to the server.
Code Example
<%
Dim SecObj
Dim MyIPSec
Dim IPList, DomainList
Set SecObj = GetObject("IIS://LocalHost/W3SVC/1")
Set MyIPSec = SecObj.IPSecurity
'Test value of MyIPSec.GrantByDefault here.
DomainList = MyIPSec.DomainDeny
IPList = MyIPSec.IPDeny
Redim IPList (Ubound(IPList)+1)
IPList (Ubound(IPList)) = "123.0.0.1,255.255.255.0"
Redim DomainList (Ubound(DomainList)+1)
DomainList (Ubound(DomainList)) = "somedomain.com"
IPSec.DomainDeny = DomainList
IPSec.IPDeny = IPList
Set SecObj.IPSecurity = MyIPSec
Ojb.Setinfo
%>
See Also
IPDeny, IPGrant, DomainGrant, GrantByDefault, IIsIPSecurity
DomainGrant
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the DomainGrant property of the IIsIPSecurity object to edit lists of domains that are
Active Server Pages Guide Page 174 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
allowed access to the server.
Syntax
SecObj.DomainGrant Domain
Parameters
SecObj
An IIS Admin Object of type IIsIPSecurity.
Domain
This is the domain you want granted access to the server.
Code Example
<%
Dim SecObj
Dim MyIPSec
Dim IPList, DomainList
Set SecObj = GetObject("IIS://LocalHost/W3SVC/1")
Set MyIPSec = SecObj.IPSecurity
'Test value of MyIPSec.GrantByDefault here.
DomainList = MyIPSec.DomainGrant
IPList = MyIPSec.IPGrant
Redim IPList (Ubound(IPList)+1)
IPList (Ubound(IPList)) = "123.0.0.1,255.255.255.0"
Redim DomainList (Ubound(DomainList)+1)
DomainList (Ubound(DomainList)) = "somedomain.com"
IPSec.DomainGrant = DomainList
IPSec.IPGrant = IPList
Set SecObj.IPSecurity = MyIPSec
Ojb.Setinfo
%>
See Also
IPDeny, IPGrant, DomainDeny, GrantByDefault, IIsIPSecurity
GrantByDefault
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the GrantByDefault property of the IIsIPSecurity object to set how you would like to
specify server access. GrantByDefault is a Boolean property which determines whether the default
setting is grant all with exceptions or deny all with exceptions. If GrantByDefault is TRUE, then all IP
addresses and domains are granted access to the server (with the exception of the list entries of the
DomainDeny and IPDeny methods). If GrantByDefault is FALSE, then all IP addresses and
domains are denied access to the server (with the exception of the list entries of the DomainGrant and
IPGrant methods).
Syntax
Active Server Pages Guide Page 175 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
SecObj.GrantByDefault Boolean
Parameters
SecObj
An IIS Admin Object of type IIsIPSecurity.
Boolean
This is a value of TRUE or FALSE.
Code Example
<%
Dim SecObj
Set SecObj = GetObject("IIS://LocalHost/W3SVC/1")
'Set permissions to grant access by default.
SecObj.GrantByDefault=TRUE
SecObj.SetInfo
%>
See Also
IPDeny, IPGrant, DomainDeny, DomainGrant, IIsIPSecurity
IIsLogModule
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsLogModule object to set metabase properties that affect the operation of logging
modules. You can set filter properties at the computer level (IIsComputer), at the FTP and Web
service level, or for an individual FTP or Web server.
The IIsLogModule object is an ADSI object, but not an ADSI container object.
ADsPath
IIS://MachineName/LOGGING/LogModuleName
where MachineName can be any name or "LocalHost," and LogModuleName is the name of a log
module.
Syntax
varReturn = object.Method
Parts
Active Server Pages Guide Page 176 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsLogModule object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Properties
Metabase Properties
Methods
IIsLogModules
This is preliminary documentation for IIS 5.0 and is subject to change.
The IIsLogModules object is an ADSI container object that contains the collection of IIsLogModule
objects. You can use the IIsLogModules object to manage log modules at the computer level
(IIsComputer).
The IIsLogModules object is an ADSI container object.
ADsPath
IIS://MachineName/LOGGING
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsLogModules object, usually as a result of a previous GetObject
ADSI Object Properties
LogModuleId LogModuleUiId
ADSI Object Methods Standard methods for ADSI objects.
Active Server Pages Guide Page 177 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
operation.
Method
The object method chosen.
Can Contain
Properties
Methods
Code Example
<%
'Get log properties for a log module at a server.
Dim LoggingModules, CurrentObj
'Get the object for the first Web server.
Set CurrentObj = GetObject("IIS://LocalHost/W3SVC/1")
'Access the log modules at the computer level.
Set LoggingModules = GetObject("IIS://LocalHost/logging")
'Loop through the installed modules to find the currently
'selected module at this server.
If CurrentObj.LogPluginClsid <> "" Then
For Each LogModule in LoggingModules
If LogModule.LogModuleID = CurrentObj.LogPluginClsid Then
Response.Write LogModule.Name & "<BR>"
End If
Next
'Display a property of the current module.
Response.Write CurrentObj.LogFileDate
End If
%>
IIsMimeMap
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsMimeMap object to set the inherited Multipurpose Internet Mail Extensions
(MIME) mappings used by the Web servers.
The IIsMimeMap object is an ADSI object, but not an ADSI container object.
ADsPath
IIS://MachineName/MIMEMAP
IIsLogModule
ADSI Object Properties
ADSI Object Methods Standard methods for ADSI objects.
ADSI Container Object Methods Standard methods for ADSI container objects.
Active Server Pages Guide Page 178 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsMimeMap object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Properties
Metabase Properties
Methods
Code Example
<%
Dim MimeMapObj, aMimeMap, MMType, MMExtension, i, aMimeMapNew()
Const ADS_PROPERTY_UPDATE = 2
'Get the mimemap object.
Set MimeMapObj = GetObject("IIS://LocalHost/MimeMap")
'Get the mappings from the MimeMap property.
aMimeMap = MimeMapObj.GetEx("MimeMap")
' Display the mappings.
ShowMM(MimeMapObj)
' Add a new mapping.
i = UBound(aMimeMap) + 1
Redim Preserve aMimeMap(i)
Set aMimeMap(i) = CreateObject("MimeMap")
aMimeMap(i).Extension = ".jnq"
aMimeMap(i).MimeType = "junque/my-junque"
MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", aMimeMap
MimeMapObj.SetInfo
' Display the mappings.
ShowMM(MimeMapObj)
'Delete a mapping by copying to a new map array.
i = 0
For Each MMItem in aMimeMap
ADSI Object Properties
MimeMap
ADSI Object Methods Standard methods for ADSI objects.
Active Server Pages Guide Page 179 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
If MMItem.Extension <> ".jnq" Then
Redim Preserve aMimeMapNew(i)
Set aMimeMapNew(i) = CreateObject("MimeMap")
aMimeMapNew(i).Extension = MMItem.Extension
aMimeMapNew(i).MimeType = MMItem.MimeType
i = i + 1
End If
Next
MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", aMimeMapNew
MimeMapObj.SetInfo
'Display the mappings.
ShowMM(MimeMapObj)
'Subroutine to display the mappings in a table.
Sub ShowMM(MMObj)
aMM = MMObj.GetEx("MimeMap")
'Set up table to display mappings.
Response.Write "<HR><TABLE BORDER><CAPTION><B>MIME Maps</B></CAPTION>"
Response.Write "<TR><TH>Type</TH><TH>Extension</TH>"
'Display the mappings in the table.
For Each MM in aMM
Response.Write "<TR><TD>" & MM.MimeType & "</TD>"
Response.Write "<TD>" & MM.Extension & "</TD></TR>"
Next
Response.Write "</TABLE>"
End Sub
%>
IIsMimeType
This is preliminary documentation for IIS 5.0 and is subject to change.
The MimeMap property contains an array of IISMimeType objects. To add to the array, create a
new IISMimeType object, set its MimeType, create the Extension, add the element to the
MimeMap array, and set it in ADSI.
The IIsMimeType object is a custom ADSI Automation object.
Syntax
varMimeMap = object.MimeMap
Set objMimeType = aMimeMap(0)
Parts
aMimeMap
A variable that receives the list of IIsMimeType objects.
object
A variable that supports the MimeType property, usually as a result of a previous GetObject
operation.
objMimeType
Active Server Pages Guide Page 180 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
An object variable that receives the IIsMimeType object.
Can Contain
This object cannot contain any other objects.
Properties
ADSI Object Properties
Metabase Properties
Object Properties
See Also
IIsMimeMap, MimeMap
MimeType
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the MimeType property of the IIsMimeType object to GET and PUT the MIME types
for objects of type IISMimeType.
Syntax
DirObj.MimeType=string
Parameters
DirObj
An IIS Admin Object of type IIsMimeType.
string
This is a string that specifies the MIME type for the object.
Code Example
MimeMap This property provides a list of the file name
extensions for Multipurpose Internet Mail
Extensions (MIME) mappings. MimeMap is an
array of IISMimeType objects.
MimeType This property can be used to GET and PUT the
MimeType for the object.
Extension This property can be used to GET and PUT the
file name extension assigned to the object.
Active Server Pages Guide Page 181 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%
Dim DirObj
Dim MimeMapNode
Dim MimeMapList
Dim MimeMapEntry
Set Obj = GetObject("IIS://LH/MimeMap")
MimeMapList = DirObj.MimeMap
Redim preserve MimeMapList (Ubound(MimeMapList)+1)
Set MimeMapEntry = CreateObject ("IIsMimeTypeEntry")
MimeMapEntry.MimeType = "Text/Plain"
Mime.Extension = ".log"
Set MimeMapList (Ubound(MimeMapList)) = MimeMapEntry
DirObj.MimeMap = MimeMapList
DirObj.Setinfo
%>
See Also
IIsMimeType, Extension
Extension
This is preliminary documentation for IIS 5.0 and is subject to change.
Use the Extension property of the IIsMimeType object to specify the MIME type of the file name
extension.
Syntax
DirObj.Extension = String
Parameters
DirObj
An IIS Admin Object of type IIsMimeType.
String
This is the specific file name extension associated with the MIME type specified in the
MimeType property.
Code Example
<%
Dim DirObj
Dim MimeMapNode
Dim MimeMapList
Dim MimeMapEntry
Set Obj = GetObject("IIS://LH/MimeMap")
MimeMapList = DirObj.MimeMap
Redim preserve MimeMapList (Ubound(MimeMapList)+1)
Set MimeMapEntry = CreateObject ("IIsMimeTyepEntry")
MimeMapEntry.MimeMap = "Text/Plain"
Active Server Pages Guide Page 182 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Mime.Extension = ".log"
Set MimeMapList (Ubound(MimeMapList)) = MimeMapEntry
DirObj.MimeMap = MimeMapList
DirObj.Setinfo
%>
See Also
MimeType, IIsMimeType
IIsWebDirectory
This is preliminary documentation for IIS 5.0 and is subject to change.
The IIsWebDirectory object is used to set metabase properties that apply to one or more Web
directories for a Web server. When you use the IIsWebDirectory object to set metabase properties for
a Web directory, inheritable properties will apply to all subdirectories and files.
You can also use IIsWebDirectory methods to create and manage Web applications in Web
directories and subdirectories. Applications can also be defined and managed in virtual directories by
using IIsWebVirtualDir.
The IIsWebDirectory object is an ADSI container object.
ADsPath
IIS://MachineName/W3SVC/N/ROOT/vdirName/DirName
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsWebDirectory object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Can Contain
IIsWebDirectory IIsWebFile
Active Server Pages Guide Page 183 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Properties
Metabase Properties
ADSI Object Properties
A Asp...
AccessExecute AspBufferingOn
AccessFlags AspCodepage
AccessNoRemoteExecute AspEnableApplicationRestart
AccessNoRemoteRead AspEnableAspHtmlFallback
AccessNoRemoteScript AspEnableChunkedEncoding
AccessNoRemoteWrite AspEnableParentPaths
AccessRead AspEnableTypelibCache
AccessScript AspErrorsToNTLog
AccessSSL AspExceptionCatchEnable
AccessSSL128 AspLogErrorRequests
AccessSSLFlags AspProcessorThreadMax
AccessSSLMapCert AspQueueConnectionTestTime
AccessSSLNegotiateCert AspQueueTimeout
AccessSSLRequireCert AspRequestQueueMax
AccessWrite AspScriptEngineCacheMax
AnonymousPasswordSync AspScriptErrorMessage
AnonymousUserName AspScriptErrorSentToBrowser
AnonymousUserPass AspScriptFileCacheSize
AppAllowClientDebug AspScriptLanguage
AppAllowDebugging AspScriptTimeout
AppFriendlyName AspSessionMax
AppIsolated AspSessionTimeout
AppOopRecoverLimit AspThreadGateEnabled
AppPackageID AspThreadGateLoadHigh
AppPackageName AspThreadGateLoadLow
AppRoot AspThreadGateSleepDelay
Active Server Pages Guide Page 184 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Methods
AppWamClsID AspThreadGateSleepMax
AspAllowOutOfProcComponents AspThreadGateTimeSlice
AspAllowSessionState AspTrackThreadingModel
Auth... U
AuthAnonymous DirBrowseShowSize
AuthBasic DirBrowseShowTime
AuthFlags DontLog
AuthNTLM EnableDefaultDoc
AuthPersistence EnableDirBrowsing
AuthPersistSingleRequest EnableDocFooter
AuthPersistSingleRequestIfProxy EnableReverseDns
AuthPersistSingleRequestAlwaysIfProxy HttpCustomHeaders
CacheControlCustom HttpErrors
CacheControlMaxAge HttpExpires
CacheControlNoCache HttpPics
CacheISAPI HttpRedirect
ContentIndexed IPSecurity
CpuAppEnabled LogonMethod
CpuCgiEnabled MimeMap
CreateCGIWithNewConsole PoolIDCTimeout
CreateProcessAsUser PutReadSize
DefaultDoc Realm
DefaultDocFooter RedirectHeaders
DefaultLogonDomain ScriptMaps
DirBrowseFlags SSIExecDisable
DirBrowseShowDate UNCAuthenticationPassthrough
DirBrowseShowExtension UploadReadAheadSize
DirBrowseShowLongDate
Active Server Pages Guide Page 185 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
Remarks
Web directories can be nested, and are addressed with the path to the directory, including the directory
name (for example .../vdirName/Dir1/Dir1a/Dir1ab, and so on).
AppCreate
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppCreate method of the IIsWebDirectory or IIsWebVirtualDir object to create a
Web application definition and mark it as running in-process or out-of-process. If an application already
exists at the specified path, you can use this method to reconfigure the application from in-process to
out-of-process, or the reverse.
AppCreate Creates an application at a specified metabase
key (parameter is a Boolean).
AppCreate2 Creates an application at a specified metabase
key (parameter is a Long).
AppDelete Deletes an application definition at a specified
key.
AppDeleteRecursive Deletes application definitions at a specified key
and subkeys.
AppDisable Disables an application at a specified key.
AppDisableRecursive Disables applications at a specified key and
subkeys.
AppEnable Enables an application that was previously
disabled at a specified key.
AppEnableRecursive Enables applications that were previously disabled
at a specified key and subkeys.
AppGetStatus Retrieves the status of an application.
AppUnload Unloads an application at a specified key.
AppUnloadRecursive Unloads applications at a specified key and
subkeys.
AspAppRestart This method restarts the ASP application that
invoked it.
ADSI Object Methods Standard methods for ADSI objects.
ADSI Container Object Methods Standard methods for ADSI container objects.
Active Server Pages Guide Page 186 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Syntax
DirObj.AppCreate InProcFlag
Parameters
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
InProcFlag
Specifies whether the application being created is to run in-process (TRUE) or out-of-process
(FALSE). If the application already exists and is running in-process, specifying this flag as FALSE
will cause the application definition to be deleted and a new application created to run out-of-
process. If the application already exists and is running out-of-process, specifying this flag as
TRUE will cause the application definition to be deleted and a new application created to run in-
process. If the application exists, and the setting of InProcFlag matches the application's existing
in-process or out-of-process status, then this method will cause no change to the application
definition.
Code Example
<%
Dim DirObj
Const INPROC = True
Const OUTPROC = False
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Create an application in-process.
DirObj.AppCreate INPROC
%>
See Also
AppCreate2, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive,
AppGetStatus, AppDisable, AppDisableRecursive, AppEnable, AppEnableRecursive,
AspAppRestart
AppCreate2
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppCreate2 method of the IIsWebDirectory or IIsWebVirtualDir object to create
a Web application definition and mark it as running in-process, out-of-process, or in a process pool. If
an application already exists at the specified path, you can use this method to reconfigure the application
to run in whatever process space you want.
Syntax
DirObj.AppCreate InProcFlag
Active Server Pages Guide Page 187 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Parameters
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
InProcFlag
Binary value that specifies whether the application being created is to run in-process (0), out-of-
process (1), or in a pooled process (2). If the application already exists and is running , changing
the value of this flag will cause the application definition to be deleted and a new application
created to run in the specified process space.
Code Example
<%
Dim DirObj
Const INPROC = 0
Const OUTPROC = 1
Const POOLED = 2
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Create an application in-process.
DirObj.AppCreate INPROC
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive,
AppGetStatus, AppDisable, AppDisableRecursive, AppEnable, AppEnableRecursive,
AspAppRestart
AppDelete
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppDelete method of the IIsWebDirectory or IIsWebVirtualDir object to delete a
Web application definition from a metabase key. If the application is running, it will be shut down. If the
application is in-process with IIS, all resources associated with the application, such as out-of-process
applications, will be released if the resource is not referenced by another in-process application.
NoteServer component DLLs are not released from in-process applications, even if they are not
currently referenced by other applications.
Deletions performed by using AppDelete cannot be undone.
Syntax
DirObj.AppDelete
Parameters
Active Server Pages Guide Page 188 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
DirObj
An IIS Admin object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Delete the application at this directory.
DirObj.AppDelete
%>
See Also
AppCreate, AppDeleteRecursive, AppUnload, AppUnloadRecursive, AppGetStatus,
AppDisable, AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart
AppDeleteRecursive
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppDeleteRecursive method of the IIsWebDirectory or IIsWebVirtualDir object
to delete Web application definitions from a metabase key and all subkeys. If the applications are
running, they will be shut down. If the application is in-process with IIS, all resources associated with the
application, such as out-of-process packages, will be released if the resource is not referenced by
another in-process application.
NoteServer component DLLs are not released from in-process applications, even if they aren't
currently referenced by other applications.
Deletions performed using AppDeleteRecursive cannot be undone.
Syntax
DirObj.AppDeleteRecursive
Parameters
DirObj
An IIS Admin object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Delete the application at this directory
'and all subdirectories.
DirObj.AppDeleteRecursive
Active Server Pages Guide Page 189 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
%>
See Also
AppCreate, AppDelete, AppUnload, AppUnloadRecursive, AppGetStatus, AppDisable,
AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart
AppDisable
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppDisable method of the IIsWebDirectory or IIsWebVirtualDir object to disable
a Web application that is running out-of-process. All of the application's resources are released and the
application's process is terminated. Attempts to access this application will fail. You can use the
AppEnable method to re-enable a disabled application. Both methods are used primarily when moving,
copying, or renaming metabase keys. The AppDisable method has no effect if the application is running
in-process.
Syntax
DirObj.AppDisable
Parameters
DirObj
An IIS Admin object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Disable the application at this directory.
DirObj.AppDisable
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive,
AppGetStatus, AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart
AppDisableRecursive
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppDisableRecursive method of the IIsWebDirectory or IIsWebVirtualDir
object to disable Web applications that are running out-of-process. The applications at the specified key
Active Server Pages Guide Page 190 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
and at all subordinate keys will be disabled. All of the application resources are released and the
application processes are terminated. Attempts to access this application will fail. You can use the
AppEnableRecursive method to re-enable disabled applications. Both methods are used primarily
when moving, copying, or renaming metabase keys. The AppDisableRecursive method has no effect if
the applications are running in-process.
Syntax
DirObj.AppDisableRecursive
Parameters
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Disable the application at this directory
'and at all subdirectories.
DirObj.AppDisableRecursive
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive,
AppGetStatus, AppDisable, AppEnable, AppEnableRecursive, AspAppRestart
AppEnable
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppEnable method of the IIsWebDirectory or IIsWebVirtualDir object to reinstate
a Web application definition that was previously disabled with the AppDisable method. If the
application specified was not previously deleted, it will be reregistered with Component Services.
Syntax
DirObj.AppEnable
Parameters
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
Active Server Pages Guide Page 191 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Enable the application at this directory.
DirObj.AppEnable
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive,
AppGetStatus, AppDisable, AppDisableRecursive, AppEnableRecursive, AspAppRestart
AppEnableRecursive
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppEnableRecursive method of the IIsWebDirectory or IIsWebVirtualDir object
to reinstate Web application definitions that were previously disabled with the AppDisableRecursive
method. If the applications specified were not previously deleted, they will be reregistered with
Component Services.
Syntax
DirObj.AppEnableRecursive
Parameters
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Enable the application at this directory
'and at all subdirectories.
DirObj.AppEnableRecursive
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive,
AppGetStatus, AppDisable, AppDisableRecursive, AppEnable, AspAppRestart
AppGetStatus
Active Server Pages Guide Page 192 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppGetStatus method of the IIsWebDirectory or IIsWebVirtualDir object to
retrieve the current status of a Web application.
Syntax
vReturn = DirObj.AppGetStatus
Parameters
vReturn
Receives the status of the application.
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
Return Values
Code Example
<%
Dim DirObj, vStatus
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Get the status of the application.
vReturn = DirObj.AppGetStatus
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive, AppDisable,
AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart
AppUnload
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppUnload method of the IIsWebDirectory or IIsWebVirtualDir object to unload
a Web application that is running out-of-process. All of the application's resources are released and the
application's process is terminated. If the application is running in-process, the application is released if it
is not being referenced by any other applications.
NoteServer component DLLs are not released from in-process applications, even if they aren't
APPSTATUS_NOTDEFINED No application is defined at the specified path.
APPSTATUS_RUNNING The application is running.
APPSTATUS_STOPPED The application is not running.
Active Server Pages Guide Page 193 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
currently referenced by other applications.
Syntax
DirObj.AppUnload
Parameters
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Unload the application at this directory.
DirObj.AppUnload
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnloadRecursive, AppGetStatus,
AppDisable, AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart
AppUnloadRecursive
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AppUnloadRecursive method of the IIsWebDirectory or IIsWebVirtualDir object
to unload Web applications that are running out-of-process. The applications at the specified key and at
all subordinate keys will be unloaded. All of the application resources are released and the application
processes are terminated. If the application is running in-process, the application is released if it is not
being referenced by any other applications.
NoteServer component DLLs are not released from in-process applications, even if they aren't
currently referenced by other applications.
Syntax
DirObj.AppUnloadRecursive
Parameters
DirObj
An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
Code Example
Active Server Pages Guide Page 194 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%
Dim DirObj
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Unload the application at this directory
'and all subordinate directories.
DirObj.AppUnloadRecursive
%>
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppGetStatus, AppDisable,
AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart
AspAppRestart
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the AspAppRestart method of the IIsWebDirectory or IIsWebVirtualDir object to
restart ASP applications. Users can use this method to restart ASP applications without accessing the
Global.asa file or stopping and starting the Web service itself. Essentially, a user can restart the
application on demand.
Syntax
DirObj.AspAppRestart()
Parameters
DirObj
An ASP application object of type IIsWebDirectory or IIsWebVirtualDir.
See Also
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive,
AppGetStatus, AppDisable, AppDisableRecursive, AppEnable, AppEnableRecursive
IIsWebFile
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsWebFile object to set metabase key values that apply to a file in a Web directory
for a Web virtual server. Metabase property values set for a specific file will override inherited values
that have been set at a higher level in the metabase hierarchy.
The IIsWebFile object is an ADSI object, but not an ADSI container object.
Active Server Pages Guide Page 195 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ADsPath
IIS://MachineName/W3SVC/n/Root/vdirName/DirName/FileName
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsWebFile object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Properties
Metabase Properties
ADSI Object Properties
AccessExecute CacheControlMaxAge
AccessFlags CacheControlNoCache
AccessNoRemoteExecute CpuAppEnabled
AccessNoRemoteRead CpuCgiEnabled
AccessNoRemoteScript CreateCGIWithNewConsole
AccessNoRemoteWrite CreateProcessAsUser
AccessRead DefaultDocFooter
AccessSource DefaultLogonDomain
AccessScript DontLog
AccessSSL EnableDocFooter
AccessSSL128 EnableReverseDns
AccessSSLFlags HttpCustomHeaders
AccessSSLMapCert HttpErrors
AccessSSLNegotiateCert HttpExpires
Active Server Pages Guide Page 196 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Methods
IIsWebInfo
This is preliminary documentation for IIS 5.0 and is subject to change.
Some metabase properties associated with the Web service are stored at the Info subkey of the
W3SVC key. You can use the IIsWebInfo object to set values for these properties.
The IIsWebInfo object is an ADSI object, but not an ADSI container object.
ADsPath
IIS://MachineName/W3SVC/INFO
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
AccessSSLRequireCert HttpPics
AccessWrite HttpRedirect
AnonymousPasswordSync IPSecurity
AnonymousUserName LogonMethod
AnonymousUserPass MimeMap
AuthAnonymous PoolIDCTimeout
AuthBasic PutReadSize
AuthFlags Realm
AuthNTLM RedirectHeaders
AuthPersistence ScriptMaps
AuthPersistSingleRequest SSIExecDisable
AuthPersistSingleRequestIfProxy UNCAuthenticationPassthrough
AuthPersistSingleRequestAlwaysIfProxy UploadReadAheadSize
CacheControlCustom
ADSI Object Methods Standard methods for ADSI objects.
Active Server Pages Guide Page 197 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsWebInfo object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Properties
Metabase Properties
Methods
IIsWebServer
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsWebServer object to set metabase properties that apply to a specific Web virtual
server, and to set inheritable metabase properties for virtual directories, Web directories, and Web files.
Specific methods are also available to control server operation. Web virtual servers are identified in the
metabase by their index numbers. The first Web server is number 1, the second is number 2, and so on.
The IIsWebServer object is an ADSI container object.
ADsPath
IIS://MachineName/W3SVC/N
where MachineName can be any computer name or "LocalHost."
Syntax
varReturn = objWebServer.Method
Code Example
<%
Dim ServerObj
'Continue the second Web server.
Set ServerObj = GetObject("IIS://LocalHost/W3SVC/2")
ServerObj.Continue
%>
See Also
Start, Pause, Stop, Status
Pause
This is preliminary documentation for IIS 5.0 and is subject to change.
The Pause method of the IIsWebServer object pauses the server operation.
Syntax
IIsWebServer.Pause
Code Example
<%
Dim ServerObj
'Pause the second Web server.
Set ServerObj = GetObject("IIS://LocalHost/W3SVC/2"
ServerObj.Pause
%>
See Also
Start, Continue, Stop, Status
Start
Active Server Pages Guide Page 203 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The Start method of the IIsWebServer object starts the server operation.
Syntax
IIsWebServer.Start
Code Example
<%
Dim ServerObj
'Start the second Web server.
Set ServerObj = GetObject("IIS://LocalHost/W3SVC/2"
ServerObj.Start
%>
See Also
Pause, Continue, Stop, Status
Status
This is preliminary documentation for IIS 5.0 and is subject to change.
The Status method of the IIsWebServer object returns an integer that indicates the current status of the
server. The possible values are 1 (starting), 2 (started), 3 (stopping), 4 (stopped), 5 (pausing), 6
(paused), or 7 (continuing).
Syntax
IIsWebServer.Status
See Also
Start, Pause, Continue, Stop
Stop
This is preliminary documentation for IIS 5.0 and is subject to change.
The Stop method of the IIsWebServer object stops the server operation.
Syntax
Active Server Pages Guide Page 204 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIsWebServer.Stop
Code Example
<%
Dim ServerObj
'Stop the second Web server.
Set ServerObj = GetObject("IIS://LocalHost/W3SVC/2"
ServerObj.Stop
%>
See Also
Start, Pause, Continue, Status
IIsWebService
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsWebService object to set inheritable metabase properties for Web sites and Web
virtual directories. The DownlevelAdminInstance property indicates the specific Web server instance
to administer (for IIS 2.0 Internet Server Manager clients performing remote administration of IIS 5.0).
The IIsWebService object is an ADSI container object. For more information, see ADSI Features.
ADsPath
IIS://MachineName/W3SVC
where MachineName can be any computer name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsWebServer object, usually as a result of a previous GetObject
operation.
Method
The object method chosen.
Can Contain
Active Server Pages Guide Page 205 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Properties
Metabase Properties
IIsFilters IIsWebServer
IIsWebInfo
ADSI Object Properties
A Asp...
AccessExecute AspAllowSessionState
AccessFlags AspBufferingOn
AccessNoRemoteExecute AspCodepage
AccessNoRemoteRead AspEnableApplicationRestart
AccessNoRemoteScript AspEnableAspHtmlFallback
AccessNoRemoteWrite AspEnableChunkedEncoding
AccessRead AspEnableParentPaths
AccessSource AspEnableTypelibCache
AccessScript AspErrorsToNTLog
AccessSSL AspExceptionCatchEnable
AccessSSL128 AspLogErrorRequests
AccessSSLFlags AspProcessorThreadMax
AccessSSLMapCert AspQueueConnectionTestTime
AccessSSLNegotiateCert AspQueueTimeout
AccessSSLRequireCert AspRequestQueueMax
AccessWrite AspScriptEngineCacheMax
AdminACL AspScriptErrorMessage
AllowPathInfoForScriptMappings AspScriptErrorSentToBrowser
AnonymousPasswordSync AspScriptFileCacheSize
AnonymousUserName AspScriptLanguage
AnonymousUserPass AspSessionMax
AppAllowClientDebug AspScriptTimeout
AppAllowDebugging AspSessionTimeout
Active Server Pages Guide Page 206 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AppFriendlyName AspThreadGateEnabled
AppIsolated AspThreadGateLoadHigh
AppPackageID AspThreadGateLoadLow
AppPackageName AspThreadGateSleepDelay
AppRoot AspThreadGateSleepMax
AppWamClsID AspThreadGateTimeSlice
AspAllowOutOfProcComponents AspTrackThreadingModel
Auth... I
AuthAnonymous CpuLimitsEnabled
AuthBasic CpuLoggingInterval
AuthFlags CpuLoggingMask
AuthNTLM CpuLoggingOptions
AuthPersistence CpuResetInterval
AuthPersistSingleRequest CreateCGIWithNewConsole
AuthPersistSingleRequestIfProxy CreateProcessAsUser
AuthPersistSingleRequestAlwaysIfProxy DefaultDoc
CacheControlCustom DefaultDocFooter
CacheControlMaxAge DefaultLogonDomain
CacheControlNoCache DirBrowseFlags
CacheISAPI DirBrowseShowDate
ContentIndexed DirBrowseShowExtension
ConnectionTimeout DirBrowseShowLongDate
CpuAppEnabled DirBrowseShowSize
CpuCgiEnabled DirBrowseShowTime
CpuEnableActiveProcs DirectoryLevelsToScan
CpuEnableAllProcLogging DisableSocketPooling
CpuEnableAppLogging DontLog
CpuEnableCgiLogging DownlevelAdminInstance
CpuEnableEvent EnableDefaultDoc
CpuEnableKernelTime EnableDirBrowsing
CpuEnableLogging EnableDocFooter
Active Server Pages Guide Page 207 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CpuEnablePageFaults EnableReverseDns
CpuEnableProcType HttpCustomHeaders
CpuEnableTerminatedProcs HttpErrors
CpuEnableTotalProcs HttpExpires
CpuEnableUserTime HttpPics
CpuLimitLogEvent HttpRedirect
CpuLimitPause InProcessIsapiApps
CpuLimitPriority IPSecurity
CpuLimitProcStop
Log...
LogExtFileBytesRecv LogExtFileUriQuery
LogExtFileBytesSent LogExtFileUriStem
LogExtFileClientIp LogExtFileUserAgent
LogExtFileComputerName LogExtFileUserName
LogExtFileCookie LogExtFileWin32Status
LogExtFileDate LogFileDirectory
LogExtFileFlags LogFileLocaltimeRollover
LogExtFileHttpStatus LogFilePeriod
LogExtFileMethod LogFileTruncateSize
LogExtFileProtocolVersion LogOdbcDataSource
LogExtFileReferer LogOdbcPassword
LogExtFileServerIp LogOdbcTableName
LogExtFileServerPort LogOdbcUserName
LogExtFileSiteName LogonMethod
LogExtFileTime LogPluginClsId
LogExtFileTimeTaken LogType
M U
MaxConnections ScriptMaps
MaxEndpointConnections ServerAutoStart
MimeMap ServerBindings
NetLogonWorkstation ServerComment
Active Server Pages Guide Page 208 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Methods
IIsWebVirtualDir
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the IIsWebVirtualDir object to set metabase properties that apply to one or all virtual
directories for a Web site. If you use the IIsWebVirtualDir object at the server's ROOT directory
(.../W3SVC/2/ROOT), inheritable property values will apply to all virtual subdirectories. You can set
properties for a specific virtual directory by using the IIsWebVirtualDir object for a specific virtual
directory (.../W3SVC/2/ROOT/AVdir).
You can also use IIsWebVirtualDir methods to create and manage Web applications in Web virtual
directories and virtual subdirectories. Applications can also be defined and managed in Web directories.
See IIsWebDirectory.
The IIsWebVirtualDir object is an ADSI container object.
ADsPath
For the server's root virtual directory,
IIS://MachineName/W3SVC/N/ROOT
where MachineName can be any name or "LocalHost."
For a specific virtual directory,
NTAuthenticationProviders ServerListenBacklog
PasswordCacheTTL ServerListenTimeout
PasswordChangeFlags ServerSize
PasswordExpirePrenotifyDays SSIExecDisable
PoolIDCTimeout SSLUseDSMapper
ProcessNTCRIfLoggedOn UNCAuthenticationPassthrough
PutReadSize UploadReadAheadSize
Realm UseHostName
RedirectHeaders WAMUserName
WAMUserPass
ADSI Object Methods Standard methods for ADSI objects
ADSI Container Object Methods Standard methods for ADSI container objects
Active Server Pages Guide Page 209 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS://MachineName/W3SVC/N/ROOT/vdirName
where MachineName can be any name or "LocalHost."
Syntax
varReturn = object.Method
Parts
varReturn
A variable that receives the return value from the method.
object
A variable that contains the IIsWebVirtualDir object, usually as a result of a previous
GetObject operation.
Method
The object method chosen.
Can Contain
Properties
Metabase Properties
IIsWebVirtualDir IIsWebFile
IIsWebDirectory
ADSI Object Properties
A Asp...
AccessExecute AspBufferingOn
AccessFlags AspCodepage
AccessNoRemoteExecute AspEnableApplicationRestart
AccessNoRemoteRead AspEnableAspHtmlFallback
AccessNoRemoteScript AspEnableChunkedEncoding
AccessNoRemoteWrite AspEnableParentPaths
AccessRead AspEnableTypelibCache
AccessSource AspErrorsToNTLog
AccessScript AspExceptionCatchEnable
AccessSSL AspLogErrorRequests
Active Server Pages Guide Page 210 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AccessSSL128 AspProcessorThreadMax
AccessSSLFlags AspQueueConnectionTestTime
AccessSSLMapCert AspQueueTimeout
AccessSSLNegotiateCert AspRequestQueueMax
AccessSSLRequireCert AspScriptEngineCacheMax
AccessWrite AspScriptErrorMessage
AnonymousPasswordSync AspScriptErrorSentToBrowser
AnonymousUserName AspScriptFileCacheSize
AnonymousUserPass AspScriptLanguage
AppAllowClientDebug AspScriptTimeout
AppAllowDebugging AspSessionMax
AppFriendlyName AspSessionTimeout
AppIsolated AspThreadGateEnabled
AppOopRecoverLimit AspThreadGateLoadHigh
AppPackageID AspThreadGateLoadLow
AppPackageName AspThreadGateSleepDelay
AppRoot AspThreadGateSleepMax
AppWamClsID AspThreadGateTimeSlice
AspAllowOutOfProcComponents AspTrackThreadingModel
AspAllowSessionState
Auth... U
AuthAnonymous DirBrowseShowTime
AuthBasic DontLog
AuthFlags EnableDefaultDoc
AuthNTLM EnableDirBrowsing
AuthPersistence EnableDocFooter
AuthPersistSingleRequest EnableReverseDns
AuthPersistSingleRequestIfProxy HttpCustomHeaders
AuthPersistSingleRequestAlwaysIfProxy HttpErrors
CacheControlCustom HttpExpires
CacheControlMaxAge HttpPics
Active Server Pages Guide Page 211 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Methods
CacheControlNoCache HttpRedirect
CacheISAPI IPSecurity
ContentIndexed LogonMethod
CpuAppEnabled MimeMap
CpuCgiEnabled Path
CreateCGIWithNewConsole PoolIDCTimeout
CreateProcessAsUser PutReadSize
DefaultDoc Realm
DefaultDocFooter RedirectHeaders
DefaultLogonDomain ScriptMaps
DirBrowseFlags SSIExecDisable
DirBrowseShowDate UNCAuthenticationPassthrough
DirBrowseShowExtension UNCPassword
DirBrowseShowLongDate UNCUserName
DirBrowseShowSize UploadReadAheadSize
AppCreate Creates an application at a specified metabase
key (parameter is a Boolean).
AppCreate2 Creates an application at a specified metabase
key (parameter is a Long).
AppDelete Deletes an application definition at a specified
key.
AppDeleteRecursive Deletes application definitions at a specified key
and its subkeys.
AppDisable Disables an application at a specified key.
AppDisableRecursive Disables applications at a specified key and its
subkeys.
AppEnable Enables an application that was previously
disabled at a specified key.
AppEnableRecursive Enables applications that were previously disabled
at a specified key and its subkeys.
AppGetStatus Retrieves the status of an application.
AppUnload Unloads an application at a specified key.
Active Server Pages Guide Page 212 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
Constants
This is preliminary documentation for IIS 5.0 and is subject to change.
The following constants are used with methods and properties of the IIS Admin Objects.
<%
Const ADS_PROPERTY_CLEAR = 1 'PutEx
Const ADS_PROPERTY_UPDATE = 2 'PutEx
Const APPSTATUS_NOTDEFINED = 4 'AppStatus
Const APPSTATUS_RUNNING = 2 'AppStatus
Const APPSTATUS_STOPPED = 3 'AppStatus
Const APPSTATUS_UNLOADED = 1 'AppStatus
Const IIS_ANY_PROPERTY = 0 'GetDataPaths
Const IIS_INHERITABLE_ONLY = 1 'GetDataPaths
Const MD_ERROR_DATA_NOT_FOUND = &H800CC801 'GetDataPaths
Const MD_ERROR_IISAO_INVALID_SCHEMA = &H8800CC810 'GetObject
Const MD_BACKUP_FORCE_BACKUP = 4 'Backup
Const MD_BACKUP_HIGHEST_VERSION = &HFFFFFFFE 'Backup, Delete, Restore
Const MD_BACKUP_MAX_VERSION = 9999 'Limit
Const MD_BACKUP_MAX_LEN = 100 'Limit
Const MD_BACKUP_NEXT_VERSION = &HFFFFFFFF 'Backup
Const MD_BACKUP_OVERWRITE = 1 'Backup
Const MD_BACKUP_SAVE_FIRST = 2 'Backup
Const MD_SERVER_STATE_CONTINUING = 7 'ServerState
Const MD_SERVER_STATE_PAUSING = 5 'ServerState
Const MD_SERVER_STATE_PAUSED = 6 'ServerState
Const MD_SERVER_STATE_STARTING = 1 'ServerState
Const MD_SERVER_STATE_STARTED = 2 'ServerState
Const MD_SERVER_STATE_STOPPING = 3 'ServerState
Const MD_SERVER_STATE_STOPPED = 4 'ServerState
Const NOT_A_VALID_PROPERTY = &H80005006 'Various methods
%>
ADSI Reference
This is preliminary documentation for IIS 5.0 and is subject to change.
AppUnloadRecursive Unloads applications at a specified key and its
subkeys.
AspAppRestart This method restarts the ASP application that
invoked it.
ADSI Object Methods Standard methods for ADSI objects.
ADSI Container Object Methods Standard methods for ADSI container objects.
Active Server Pages Guide Page 213 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The ADSI Reference section describes properties and methods that are exposed by the IIS Admin
Objects. This section contains:
? ADSI Object Properties: Describes the six basic properties that must be implemented by IIS
Admin Objects (Name, ADsPath, Class, GUID, Parent, and Schema).
? ADSI Object Methods: Lists the methods exposed by the IIS Admin Objects.
? ADSI Container Object Properties: Discusses additional attributes implemented by the IIS Admin
Container Object.
? ADSI Container Object Methods: Describes methods, implemented by the ADSI Container
Object, that manipulate IIS Admin Objects and metabase keys.
? ADSI Changes for IIS5.0: A quick reference to IIS ADSI provider changes in IIS5.0.
ADSI Object Properties
This is preliminary documentation for IIS 5.0 and is subject to change.
The IIS Admin Objects implement the six basic properties that ADSI objects require. The data type for
all of these properties is string.
The ADSI object properties are read-only and are provided for use with ADSI client programs for
ADSI namespace administration. The following table provides an example of the ADSI properties for the
IIsWebService object. LocalHost is a placeholder for the name of the local computer on which IIS is
running.
ADSI Property Description
Name The name of the object used within the underlying
namespace.
ADsPath The path that uniquely identifies the object, and
which is used in GetObject to retrieve the object.
Class The name of the schema class of the object.
GUID A unique identifier for objects of this schema class.
IIS uses the globally unique identifier (GUID).
Parent The ADsPath of the parent container object.
Schema The ADsPath of the object that represents this
schema class in the schema.
ADSI Property Value
Name W3SVC
ADsPath IIS://LocalHost/W3SVC
Class IIsWebService
Active Server Pages Guide Page 214 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
You can use the ADSI Name property to document the structure of your IIS installation.
You can use the metabase properties supported by the IIS Admin Objects to control the configuration of
your IIS installation. See ADSI Object Methods and the specific metabase properties supported by each
of the individual IIS Admin Objects.
ADSI Object Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the ADSI methods of the IIS Admin Objects to change metabase property values that
control your IIS configuration. To configure a specific element of IIS, open the IIS Admin Object that
corresponds to the metabase key associated with that element, modify the property values cached in the
object, and direct the object to store the modified values in the metabase.
The following ADSI methods are exposed by the IIS Admin Objects, and can be used to set or query
metabase properties.
The GetInfo method reloads the property values from the metabase into the object. When one of the
IIS Admin Objects is created or opened with the GetObject function, its properties are initialized from
the metabase. You can refresh these values from the metabase by using the GetInfo method, and
overwriting any changes you have made to the property values cached in the object. You then use the
GUID {8B645280-7BA4-11CF-B03D-
00AA006E0975}
Parent IIS://LocalHost
Schema IIS://LocalHost/schema/IIsWebService
Method Description
Get Retrieves a value for a named property from the object.
GetDataPaths Retrieves the paths to all locations of a metabase property subordinate to a
specified starting path.
GetEx Retrieves a value or values for a named single-valued or multivalued
property of the object.
GetInfo Reloads the object with property values that exist in the metabase.
GetPropertyAttribObj Retrieves an object that contains the property's attributes. This object can
then be used to retrieve individual attributes of ADSI properties.
Put Sets the value for a named property of an object.
PutEx Sets the value or values for a named single-valued or multivalued property
of the object.
SetInfo Writes the object property values to the metabase.
Active Server Pages Guide Page 215 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Get or GetEx methods to retrieve the object properties and assign these values to variables, and the
Put and PutEx methods to modify property values in the object.
The IIS Admin Objects also support the object.property syntax when used with languages such as
VBScript or JScript. You can use the SetInfo method to write property values from the object to the
metabase. When you call SetInfo, only the properties that you changed in the object are written back to
the metabase. If you do not call SetInfo, your changes will not be written to the metabase.
NoteWhen you bind to the metabase to modify properties in one of the IIS Admin Objects, the
metabase is not locked while you are changing property values in the object. Other programs can make
changes to values in the metabase after you have retrieved values but before you save them back into the
metabase. Your program should minimize the time between retrieving and saving values.
ADSI properties apply only to the object, and non-ADSI properties apply to the metabase. You must
use the object.property syntax when retrieving ADSI properties, whereas you can use either the
object.property syntax or the ADSI methods such as Get and Put when manipulating metabase
properties.
Example
The following sample VBScript code shows how you can use the ADSI methods of the IIS Admin
Objects to change values in the metabase, and illustrates the use of metabase property inheritance for
efficiency. MyComputer is a placeholder for the name of the computer on which IIS is running.
<%
Dim WebServerObj
Dim VDirObj
Dim WritePerm
'Open the object for the first virtual Web server root.
Set WebServerObj = GetObject("IIS://MyComputer/W3SVC/1/Root")
'Deny write access for all directories and files
'for the server (except those already specifically set)
'by using the Put method.
WebServerObj.Put "AccessWrite", False
'Save the changed value to the metabase.
WebServerObj.SetInfo
'Get a directory subordinate to the Web server root.
Set VDirObj = GetObject("IIS://MyComputer/W3SVC/1/Root/Vdir1/Dir1a")
'Overwrite the inherited value for write access
'by using the dot method equivalent to Put.
VDirObj.AccessWrite = True
'Save the changed value to the metabase.
VDirObj.SetInfo
%>
Get
Active Server Pages Guide Page 216 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI Get method for IIS Admin Objects retrieves a metabase property value from the object and
stores it in a variable. Some languages, such as VBScript, also support the object.property syntax as an
alternative to the Get and Put methods.
Syntax
value = object.Get(property)
or
value = object.property
Parts
value
Receives the returned value of the property.
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
property
A property of the object that has been retrieved from the metabase.
Code Example
<%
Dim IIsObj, vRead, vWrite
Set IIsObj = GetObject("IIS://LocalHost/W3SVC/1/Root")
'Get the value from the object.
vRead = IIsObj.Get("AccessRead")
'Can also use object.property syntax.
vWrite = IIsObj.AccessWrite
'Set the values.
vRead = True
vWrite = False
'Put the values back in the object.
IIsObj.Put "AccessRead", vRead
'Use optional object.property syntax.
IIsObj.AccessWrite = vWrite
'Save the changes back to the metabase.
IIsObj.SetInfo
%>
See Also
GetInfo, SetInfo, Put, GetEx, PutEx
GetDataPaths
Active Server Pages Guide Page 217 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI GetDataPaths method can be used with any of the IIS Admin Objects to find the paths to
metabase keys where a specified property is located. This method can be used to find occurrences of a
property that could be preventing subkeys from inheriting values. The path search will start at the key
associated with the object you use GetDataPaths with, and will return the starting path if the property is
located at that key. For example, if you use GetDataPaths with the IIsWebServer object for the third
Web server, the search path would start at IIS://LocalHost/W3SVC/3 and would return the paths
IIS://LocalHost/W3SVC/3, IIS://LocalHost/W3SVC/3/ROOT/VDir1, and
IIS://LocalHost/W3SVC/3/ROOT/VDir1/Dir1/File1, if those were the keys where the property was
found.
A parameter of the method enables you to specify whether to limit your search to seeking only paths of
an inheritable property, or all property paths. You can use GetDataPaths to determine if a property is
inheritable, as well as where occurrences of it are located.
Syntax
PathList = object.GetDataPaths(property, AttributeFlag)
Parts
PathList
Receives the list of paths to occurrences of the specified property.
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
property
The name of the property whose paths are to be located.
AttributeFlag
One of the following flags:
Remarks
You can use the For each Path in PathList...Next statement to retrieve individual paths from
PathList.
Code Example
<%
Const IIS_ANY_PROPERTY = 0
Const IIS_INHERITABLE_ONLY = 1
Const MD_ERROR_DATA_NOT_FOUND = &H800CC801
Dim WebSvrObj, PathList, vProperty
IIS_ANY_PROPERTY Retrieve paths regardless of whether the
property is inheritable.
IIS_INHERITABLE_ONLY Retrieve paths only if the property is
inheritable. Return
MD_ERROR_DATA_NOT_FOUND if
property is not inheritable.
Active Server Pages Guide Page 218 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
On Error Resume Next
'Get the object for the first Web server.
Set WebSvrObj = GetObject("IIS://LocalHost/W3SVC/1")
'Get the paths where a property is located.
vProperty = "AccessFlags"
PathList = WebSvrObj.GetDataPaths(vProperty, IIS_INHERITABLE_ONLY)
If Err.Number = 0 Then
Response.Write "Paths for property " & vProperty & "<BR>"
For each Path in PathList
Response.Write Path & "<BR>"
Next
ElseIf Err.Number = MD_ERROR_DATA_NOT_FOUND Then
Response.Write "Property is not inheritable.<BR>"
ElseIf Err.Number = &H80005006 Then
Response.Write "Property does not exist.<BR>"
Else
Response.Write "Error " & Err.Number & " " & Err.Description
End If
%>
GetEx
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI GetEx method retrieves a single-valued or multivalued property value from the object and
puts it into a variant-array variable.
Syntax
value = object.GetEx(property)
Parts
value
Receives the returned property value from the method.
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
property
A property of the object that has been retrieved from the metabase.
Return Values
Returns the value of the property.
Code Example
<%
Dim IIsObj, vList
Set IIsObj = GetObject("IIS://LocalHost/W3SVC/Info")
'Get the value from the object.
vList = IIsObj.GetEx("CustomErrorDescriptions")
'Modify the list.
Active Server Pages Guide Page 219 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
'Put the values back in the object
IIsObj.PutEx 2, "CustomErrorDescriptions", vList
IIsObj.SetInfo
%>
See Also
GetInfo, SetInfo, Get, Put, PutEx
GetInfo
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI GetInfo method re-initializes the object's properties by using values from the metabase.
Because the object's properties are automatically initialized when the object is created, you need to use
this method only if you want to refresh properties in the object with current values from the metabase.
Syntax
object.GetInfo
Parts
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
Code Example
<%
Dim IIsObj
Set IIsObj = GetObject("IIS://LocalHost/W3SVC/1/Root")
'Make some changes to properties.
' . . .
'Discard changes and refresh property values in the object.
IIsObj.GetInfo
%>
See Also
SetInfo, Get, Put, GetEx, PutEx
GetPropertyAttribObj
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use this method to access information about attributes for individual ADSI properties.
GetPropertyAttribObj works in the following way:
Active Server Pages Guide Page 220 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? Returns an object that contains the property's attributes if the property is set at that node or is set
at some parent node and is inheritable.
? Returns an Error if the property is not set at that node, or its parent node and is inheritable.
? Returns an Error if the property is not set at that node, but set at parent and not inheritable.
Syntax
Initializing:
PropAttObj = object.GetPropertyAttribObj(property)
Using:
RetBool = PropAttObj.Attribute
Parts
PropAttObj
Reference to an object that contains the property attributes for the property.
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
property
String that contains the name of the property whose attributes are being requested.
RetBool
Boolean that indicates whether the attribute specified by Attribute is enabled or disabled.
Attribute
Indicates which attribute is being queried. The possible attributes are:
Remarks
Unlike most other ADSI objects, the property attributes object does not support Get and Set methods.
Attribute Description
Inherit Specifies whether the property is inheritable.
PartialPath Indicates whether a partial path is present.
Secure Indicates whether the property is secure.
Reference Specifies if the property was received by a
reference.
Volatile Indicates whether the property is volatile.
IsInherited Specifies whether the property is inherited.
InsertPath Indicates whether a string in a property
contains a special insert value.
AllAttributes Contains all the attributes listed in this table
in one Long.
Active Server Pages Guide Page 221 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
You must use the object.property syntax to access the individual attributes of the property attribute
object.
NoteIf a call is made to AppCreate, object path information will be persisted, but you must call
SetInfo before the given object is created. If SetInfo is not called, subsequent calls to the object
created will fail.
Put
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI Put method sets the value for a metabase property in the object. Some languages, such as
VBScript, also support the object.property syntax as an alternative to the Get and Put methods.
Syntax
object.Put property, value
or
object.property = value
Parts
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
property
A property of the object that has been retrieved from the metabase.
value
The value for the property.
Code Example
<%
Dim IIsObj, vRead, vWrite
Set IIsObj = GetObject("IIS://LocalHost/W3SVC/1/Root")
'Get the value from the object.
vRead = IIsObj.Get("AccessRead")
'Can also use object.property syntax.
vWrite = IIsObj.AccessWrite
' Set the values.
vRead = True
vWrite = False
'Put the values back in the object.
IIsObj.Put "AccessRead", vRead
'Use optional object.property syntax.
IIsObj.AccessWrite = vWrite
'Save the changes back to the metabase.
IIsObj.SetInfo
%>
Active Server Pages Guide Page 222 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
GetInfo, SetInfo, Get, GetEx, PutEx
PutEx
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI PutEx method sets the value for a single-valued or multivalued metabase property in the
object. You can use PutEx to remove, or clear, a property from a metabase key.
Syntax
object.PutEx controlcode, property, value
Parts
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
controlcode
Specifies whether to update the property, or to remove the property from the object. One of:
ADS_PROPERTY_CLEAR (value 1) to remove the property, or ADS_PROPERTY_UPDATE
(value 2) to update the property.
property
A property of the object that has been retrieved from the metabase.
value
The value for the property. An empty string when removing the property (controlcode =
ADS_PROPERTY_CLEAR).
Remarks
For a metabase property to use inherited data at a key, the property must not already exist at the key; if
it does, you can remove it by using ADS_PROPERTY_CLEAR. (You can use the GetDataPaths
method common to all IIS Admin Objects to locate the keys where a property exists.)
Code Example
<%
Dim IIsObj, vList
Set IIsObj = GetObject("IIS://LocalHost/W3SVC/Info")
'Get the value from the object.
vList = IIsObj.GetEx("CustomErrorDescriptions")
'Modify the list.
'Put the values back in the object.
IIsObj.PutEx 2, "CustomErrorDescriptions", vList
'Remove another property from the object.
IIsObj.PutEx 1, "ObsoleteProperty", ""
IIsObj.SetInfo
%>
Active Server Pages Guide Page 223 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
GetInfo, SetInfo, Get, Put, GetEx
SetInfo
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI SetInfo method saves changed property values from the object to the metabase. After you
have changed some or all of the values in the object properties, you must use the SetInfo method to
save the new values back into the metabase. Only the values you changed will be saved back into the
metabase; unchanged values will not be overwritten.
Syntax
object.SetInfo
Parts
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
Code Example
<%
Dim IIsObj
Set IIsObj = GetObject("IIS://LocalHost/W3SVC/1/Root")
'Make some changes to properties.
' . . .
'Save the changes back to the metabase.
IIsObj.SetInfo
%>
NoteIf you attempt to create a custom object by calling AppCreate but fail to call SetInfo, any calls
to the custom object will fail because the path exists but the object does not exist. If a call to AppCreate
is made, preliminary information will be persisted, but the object will not be created until SetInfo is
called.
See Also
GetInfo, Get, Put, GetEx, PutEx
ADSI Container Object Properties
This is preliminary documentation for IIS 5.0 and is subject to change.
IIS Admin Objects that can contain other objects also can implement the ADSI container methods and
Active Server Pages Guide Page 224 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
properties. This includes the following read-only ADSI container properties:
ADSI Container Object Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the ADSI container object methods of the IIS Admin Objects to manipulate keys in the
metabase. You can create, delete, and move keys by creating, deleting, and moving IIS Admin Objects
within container objects. You can also enumerate contained objects such as virtual directories or servers
with container object methods.
These ADSI container object methods manipulate IIS Admin Objects and metabase keys:
NoteWhen one of the IIS Admin Objects is a container object, it retains its own ADSI object
properties and methods as well as any IIS-specific methods and associated metabase properties.
CopyHere
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI container object CopyHere method copies an object into a container.
Syntax
Set CopiedObj = Object.CopyHere(SourceName, NewName)
Parts
NewObj
Accesses the new object created in the container.
Active Server Pages Guide Page 226 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
KeyType
The type of IIS Admin Object to create.
Name
The name for the new object.
Code Example
<%
Dim WebServiceObj, ServerObj
'Get the Web service object, which contains servers.
Set WebServiceObj = GetObject("IIS://LocalHost/W3SVC")
'Create a new Web server object in the container.
Set ServerObj = WebServiceObj.Create("IIsWebServer", "3")
'Add code to configure server and create root virtual directory.
%>
See Also
GetObject, Delete, CopyHere, MoveHere
Delete
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI container object Delete method deletes an object from a container.
Syntax
Object.Delete KeyType, Name
Parts
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
KeyType
The type of IIS Admin Object to delete.
Name
The name of the object to delete.
Remarks
When the contained object to be deleted is part of an application, the Delete method will remove the
application definition before deleting the object. See the AppDelete method of the IIsWebVirtualDir
and IIsWebDirectory objects.
Code Example
<%
Active Server Pages Guide Page 227 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Dim WebServiceObj
'Get the Web service object, which contains servers.
Set WebServiceObj = GetObject("IIS://LocalHost/W3SVC")
'Delete the fourth server.
WebServiceObj.Delete "IIsWebServer", "4"
%>
See Also
GetObject, Create, CopyHere, MoveHere
GetObject
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI container object GetObject method accesses an object in a container.
Syntax
Set ChildObj = Object.GetObject(Class, ChildName)
Parts
ChildObj
Accesses the object in the same way as the ASP GetObject function does.
Object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
Class
Specifies the class of the object to be accessed.
ChildName
The name of the object to be accessed.
Remarks
The ChildObj variable receives a pointer to the object itself, which remains in the container.
Code Example
<%
Dim WebServiceObj, ServerObj
'Get the Web service object, which contains servers.
Set WebServiceObj = GetObject("IIS://LocalHost/W3SVC")
'Access the object for the third Web server.
Set ServerObj = WebServiceObj.GetObject("IIsWebServer", "3")
%>
See Also
Create, Delete, CopyHere, MoveHere
Active Server Pages Guide Page 228 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
MoveHere
This is preliminary documentation for IIS 5.0 and is subject to change.
The ADSI container object MoveHere method moves an object into a container and removes the
object from its origin.
Syntax
Set MovedObj = Object.MoveHere(SourceName, NewName)
Parts
MovedObj
Accesses the object moved into the container.
object
Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
SourceName
The name of the object to be moved.
NewName
The name for the moved object.
Remarks
The MovedObj variable receives a pointer to the object itself, which remains in the container.
The MoveHere method is equivalent to CopyHere followed by Delete.
When the contained object to be moved is part of an application, the MoveHere method will disable
the application definition before moving the object. See the AppDisable method of the
IIsWebVirtualDir and IIsWebDirectory objects.
Code Example
<%
Dim ToVDirObj, FromVDirObj, RootVDirObj
'Get the root virtual directory object for a server.
Set RootVDirObj = GetObject("IIS://LocalHost/W3SVC/3/ROOT")
'Get the object to be moved.
Set FromVDirObj = GetObject("IIS://LocalHost/W3SVC/3/ROOT/VDir1")
'Move the object and give it a new name.
Set ToVdirObj = RootVDirObj.MoveHere("VDir1", "VDir2")
'Release the source object because it has been deleted.
Set FromVDirObj = nothing
%>
See Also
GetObject, Create, Delete, CopyHere
Active Server Pages Guide Page 229 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ADSI Changes for IIS 5.0
This is preliminary documentation for IIS 5.0 and is subject to change.
This section contains information about the changes and additions in the ADSI provider for IIS5.0.
? IIS Performance Features: Describes new performance features for IIS5.0.
? ADSI Properties Removed from IIS5.0: Lists any properties that were supported in previous
versions, but which are not valid for IIS5.0.
? ADSI Properties Added to IIS5.0: Provides a list of properties new to IIS5.0, and links to each
property's full reference.
? ADSI Property Key Type Changes for IIS5.0: Lists any properties whose key type has changed
for IIS5.0.
? ADSI Properties Changed in IIS5.0: Lists any properties that have different default behavior for
IIS5.0.
IIS Performance Features
This is preliminary documentation for IIS 5.0 and is subject to change.
Site Socket Pooling
In IIS 4.0, each Web site was bound to a different IP address. This meant that each site had its own
socket, which was not shared with sites bound to other IP addresses. These sockets are created when
each site starts, and they can consume significant amounts of nonpaged memory (RAM). This memory
consumption limits the number of sites bound to IP addresses that can be created on a machine, because,
after a certain number of sites are started, the machine is out of RAM.
For IIS 5.0, this process has been modified so that sites bound to different IP addressesbut sharing
the same port numbershare the same set of sockets. The end result is that more sites can be bound to
an IP address on the same machine than in IIS4.0. In IIS5.0, these shared sockets are used flexibly
among all of the started sites, thus reducing resource consumption.
This is now the default behavior for IIS5.0. In general, this behavior should not be modified. However,
for critical sites that require a dedicated socket, you can set the DisableSocketPooling to TRUE to
revert back to the IIS4.0 behavior. This change should be made at the site level only, so that other sites
can continue to take advantage of the new socket pooling feature.
ADSI Properties Removed from IIS5.0
This is preliminary documentation for IIS 5.0 and is subject to change.
The following ADSI property is no longer available.
Active Server Pages Guide Page 230 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ADSI Properties Added to IIS5.0
This is preliminary documentation for IIS 5.0 and is subject to change.
ADSI properties new for IIS5.0 include the following:
AspMemFreeFactor This property is no longer available.
AccessSource CPUResetInterval
AspEnableApplicationRestart DisableSocketPooling
AspEnableAspHtmlFallback HcCacheControlHeader
AspEnableChunkedEncoding HcCompressionBufferSize
AspEnableTypelibCache HcCompressionDirectory
AspErrorsToNTLog HcCompressionDll
AspProcessorThreadMax HcCreateFlags
AspQueueConnectionTestTime HcDoDiskSpaceLimiting
AspRequestQueueMax HcDoDynamicCompression
AspSessionMax HcDoOnDemandCompression
AspTrackThreadingModel HcDoStaticCompression
CPUAppEnabled HcDynamicCompressionLevel
CPUCGIEnabled HcExpiresHeader
CPUCGILimit HcFileExtensions
CPUEnableActiveProcs HcFilesDeletedPerDiskFree
CPUEnableAllProcLogging HcIoBufferSize
CPUEnableAppLogging HcMaxDiskSpaceUsage
CPUEnableCGILogging HcMaxQueueLength
CPUEnableEvent HcMimeType
CPUEnableKernelTime HcMinFileSizeForComp
CPUEnablePageFaults HcNoCompressionForHttp10
CPUEnableProcType HcNoCompressionForProxies
CPUEnableTerminatedProcs HcNoCompressionForRange
CPUEnableTotalProcs HcOnDemandCompLevel
Active Server Pages Guide Page 231 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ADSI Property Key Type Changes for IIS5.0
This is preliminary documentation for IIS 5.0 and is subject to change.
The metabase key types for the following properties have changed since IIS4.0. To see the full property
reference for a key type, click on the link.
ADSI Properties Changed in IIS5.0
This is preliminary documentation for IIS 5.0 and is subject to change.
There is only one property change to list at this time. Check the IIS5.0 Alphabetical Property List for
detailed information.
NoteFor items that were implemented after the time of this release, see the Platform SDK.
Syntax change for ScriptMaps:
ScriptMaps property syntax has changed to required-verb inclusion rather than exclusion. (In previous
versions, it was possible to list verb exclusions, but this was not required for valid syntax.) Because of the
change from exclusions to inclusions, verbs are required in the property syntax. See ScriptMaps for
more details.
CPUEnableUserTime HcPriority
CPULimitLogEvent HcSendCacheHeaders
CPULimitPause LogCustomPropertyDataType
CPULimitPriority LogCustomPropertyHeader
CPULimitProcStop LogCustomPropertyID
CPULimitsEnabled LogCustomPropertyMask
CPULoggingInterval LogCustomPropertyName
CPULoggingMask LogCustomPropertyServicesString
CPULoggingOptions NotDeletable
SSLUseDSMapper
KeyType
FrontPageWeb
CacheISAPI
AspTrackThreadingModel
Active Server Pages Guide Page 232 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Administration Property Reference
This is preliminary documentation for IIS 5.0 and is subject to change.
Administration properties are associated with the values assigned to keys in the metabase. This reference
provides a description of each property, including the data type, default value, inheritance attribute, and
usage notes. For each property, the IIS Admin Objects that can access that property are listed. For
more information about the IIS Admin Objects, see Using IIS Admin Objects.
NoteAdditional IIS Admin Base Object information is provided for programmers who are
implementing required algorithms at the IIS Admin Base Object level.
This section contains:
? Alphabetical Property List: Provides quick access to individual property descriptions.
? ADSI vs. Base Object Data types: Provides a quick reference for those programmers
implementing required algorithms at the IIS Admin Base Object level.
Alphabetical Property List
This is preliminary documentation for IIS 5.0 and is subject to change.
A Anon
AccessExecute AccessSSLNegotiateCert
AccessFlags AccessSSLRequireCert
AccessNoRemoteExecute AccessWrite
AccessNoRemoteRead AdminACL
AccessNoRemoteScript AdminServer
AccessNoRemoteWrite AllowAnonymous
AccessRead AllowKeepAlive
AccessScript AllowPathInfoForScriptMappings
AccessSource AnonymousOnly
AccessSSL AnonymousPasswordSync
AccessSSL128 AnonymousUserName
AccessSSLFlags AnonymousUserPass
AccessSSLMapCert
App Asp
Active Server Pages Guide Page 233 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AppAllowClientDebug AspLogErrorRequests
AppAllowDebugging AspProcessorThreadMax
AppFriendlyName AspQueueConnectionTestTime
AppIsolated AspQueueTimeout
AppOopRecoverLimit AspRequestQueueMax
AppPackageID AspScriptEngineCacheMax
AppPackageName AspScriptErrorMessage
AppRoot AspScriptErrorSentToBrowser
AppWamClsID AspScriptFileCacheSize
AspAllowOutOfProcComponents AspScriptLanguage
AspAllowSessionState AspScriptTimeout
AspBufferingOn AspSessionMax
AspCodepage AspSessionTimeout
AspEnableApplicationRestart AspThreadGateEnabled
AspEnableAspHtmlFallback AspThreadGateLoadHigh
AspEnableChunkedEncoding AspThreadGateLoadLow
AspEnableParentPaths AspThreadGateSleepDelay
AspEnableTypelibCache AspThreadGateSleepMax
AspErrorsToNTLog AspThreadGateTimeSlice
AspExceptionCatchEnable AspTrackThreadingModel
Auth D
AuthAnonymous CpuEnableTerminatedProcs
AuthBasic CpuEnableTotalProcs
AuthFlags CpuEnableUserTime
AuthNTLM CpuLimitLogEvent
AuthPersistence CpuLimitPause
AuthPersistSingleRequest CpuLimitPriority
AuthPersistSingleRequestIfProxy CpuLimitProcStop
AuthPersistSingleRequestAlwaysIfProxy CpuLimitsEnabled
CacheControlCustom CpuLoggingInterval
CacheControlMaxAge CpuLoggingMask
Active Server Pages Guide Page 234 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CacheControlNoCache CpuLoggingOptions
CacheISAPI CpuResetInterval
CertCheckMode CreateCGIWithNewConsole
CGITimeout CreateProcessAsUser
ConnectionTimeout CustomErrorDescriptions
ContentIndexed DefaultDoc
CpuAppEnabled DefaultDocFooter
CpuCgiEnabled DefaultLogonDomain
CpuCgiLimit DirBrowseFlags
CpuEnableActiveProcs DirBrowseShowDate
CpuEnableAllProcLogging DirBrowseShowExtension
CpuEnableAppLogging DirBrowseShowLongDate
CpuEnableCgiLogging DirBrowseShowSize
CpuEnableEvent DirBrowseShowTime
CpuEnableKernelTime DirectoryLevelsToScan
CpuEnableLogging DisableSocketPooling
CpuEnablePageFaults DontLog
CpuEnableProcType DownlevelAdminInstance
E - K
EnableDefaultDoc HcExpiresHeader
EnableDirBrowsing HcFileExtensions
EnableDocFooter HcFilesDeletedPerDiskFree
EnableReverseDns HcIoBufferSize
ExitMessage HcMaxDiskSpaceUsage
FilterDescription HcMaxQueueLength
FilterEnabled HcMimeType
FilterFlags HcMinFileSizeForComp
FilterLoadOrder HcNoCompressionForHttp10
FilterPath HcNoCompressionForProxies
FilterState HcNoCompressionForRange
FrontPageWeb HcOnDemandCompLevel
Active Server Pages Guide Page 235 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
FtpDirBrowseShowLongDate HcPriority
GreetingMessage HcSendCacheHeaders
HcCacheControlHeader HcScriptFileExtensions
HcCompressionBufferSize HttpCustomHeaders
HcCompressionDirectory HttpErrors
HcCompressionDll HttpExpires
HcCreateFlags HttpPics
HcDoDiskSpaceLimiting HttpRedirect
HcDoDynamicCompression InProcessIsapiApps
HcDoOnDemandCompression IPSecurity
HcDoStaticCompression KeyType
HcDynamicCompressionLevel
Log...
LogAnonymous LogExtFileTimeTaken
LogCustomPropertyDataType LogExtFileUriQuery
LogCustomPropertyHeader LogExtFileUriStem
LogCustomPropertyID LogExtFileUserAgent
LogCustomPropertyMask LogExtFileUserName
LogCustomPropertyName LogExtFileWin32Status
LogCustomPropertyServicesString LogFileDirectory
LogExtFileBytesRecv LogFileLocaltimeRollover
LogExtFileBytesSent LogFilePeriod
LogExtFileClientIp LogFileTruncateSize
LogExtFileComputerName LogModuleId
LogExtFileCookie LogModuleList
LogExtFileDate LogModuleUiId
LogExtFileFlags LogNonAnonymous
LogExtFileHttpStatus LogOdbcDataSource
LogExtFileMethod LogOdbcPassword
LogExtFileProtocolVersion LogOdbcTableName
LogExtFileReferer LogOdbcUserName
Active Server Pages Guide Page 236 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
LogExtFileServerIp LogonMethod
LogExtFileServerPort LogPluginClsid
LogExtFileSiteName LogType
LogExtFileTime
M R
MaxBandWidth NotifyPreProcHeaders
MaxBandWidthBlocked NotifyReadRawData
MaxClientsMessage NotifySecurePort
MaxConnections NotifySendRawData
MaxEndpointConnections NotifySendResponse
MimeMap NotifyUrlMap
MSDOSDirOutput NTAuthenticationProviders
NetLogonWorkstation PasswordCacheTTL
NotDeletable PasswordChangeFlags
NotifyAccessDenied PasswordExpirePrenotifyDays
NotifyAuthentication Path
NotifyEndOfNetSession PoolIDCTimeout
NotifyEndOfRequest ProcessNTCRIfLoggedOn
NotifyLog PutReadSize
NotifyNonSecurePort Realm
NotifyOrderHigh RedirectHeaders
NotifyOrderLow
NotifyOrderMedium
Script... Z
ScriptMaps ServerSize
SecureBindings ServerState
ServerAutoStart SSIExecDisable
ServerBindings SSLUseDSMapper
ServerComment UNCAuthenticationPassthrough
ServerConfigAutoPWSync UNCPassword
Active Server Pages Guide Page 237 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AccessExecute
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, the AccessExecute file permission property permits execution of ASP scripts and
other executable files. AccessExecute is one of the access permission flags contained in the
AccessFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
ServerConfigFlags UNCUserName
ServerConfigSSL128 UploadReadAheadSize
ServerConfigSSL40 UseHostName
ServerConfigSSLAllowEncrypt WAMUserName
ServerListenBacklog WAMUserPass
ServerListenTimeout Win32Error
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 238 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
AccessFlags, AccessScript
AccessFlags
This is preliminary documentation for IIS 5.0 and is subject to change.
This single property contains the following file access permission flags:
Permissions established by setting AccessExecute, AccessScript, AccessNoRemoteExecute, and
AccessNoRemoteScript flags to TRUE do not apply to FTP server files.
CAUTIONSetting both write and execute permissions can be dangerous, because it allows users to
modify internal files and run potentially damaging scripts on the system.
Remote access flags are operative only when the corresponding general access flag is set. For example,
setting AccessNoRemoteRead has no effect unless AccessRead is set as well. If both are set, the
local host can read the file, but the file cannot be read by the remote client.
The AccessSource flag, if set, grants source access to clients, using the HTTP extensions described by
the Web Distributed Authoring and Versioning (WebDAV) standard. For more information on
WebDAV, see the World Wide Web Consortium and Internet Engineering Task Force Web sites.
NoteAll permissions are applicable to Web services, servers, directories, and files. Only the
AccessRead and AccessWrite permissions are applicable for the FTP services, FTP servers, and FTP
directories.
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_EXECUTE
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000004
AccessExecute AccessNoRemoteWrite
AccessNoRemoteExecute AccessRead
AccessNoRemoteRead AccessScript
AccessNoRemoteScript AccessWrite
AccessSource
Active Server Pages Guide Page 239 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
Data type Long
Default value AccessRead = TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/MSFTPSVC/N/ROOT IIsFtpVirtualDir
/LM/MSFTPSVC/N/ROOT/FtpVirtualDir IIsFtpVirtualDir
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_ACCESS_PERM
Default bitmask setting MD_ACCESS_READ
User type IIS_MD_UT_FILE
Constant Value Description
MD_ACCESS_READ 0x00000001 Allow read access.
MD_ACCESS_WRITE 0x00000002 Allow write access.
MD_ACCESS_EXECUTE 0x00000004 Allow file execution (includes
script permission).
MD_ACCESS_SOURCE 0x00000010 Allow source access.
Active Server Pages Guide Page 240 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AccessNoRemoteExecute
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property prohibits the file from being executed by remote clients.
If AccessExecute is set to TRUE, the file can be executed by the Web server.
AccessNoRemoteExecute is one of the access permission flags contained in the AccessFlags
property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
MD_ACCESS_SCRIPT 0x00000200 Allow script execution.
MD_ACCESS_NO_REMOTE_WRITE 0x00000400 Local write access only.
MD_ACCESS_NO_REMOTE_READ 0x00001000 Local read access only.
MD_ACCESS_NO_REMOTE_EXECUTE 0x00002000 Local execution only.
MD_ACCESS_NO_REMOTE_SCRIPT 0x00004000 Local host access only.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 241 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
AccessFlags
AccessNoRemoteRead
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property prohibits the file from being read by remote clients. If
AccessRead is set to TRUE, the file can be read by the Web server. AccessNoRemoteRead is one
of the access permission flags contained in the AccessFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_NO_REMOTE_EXECUTE
Metabase bitmask value 0x00002000
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 242 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
AccessFlags
AccessNoRemoteScript
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property prohibits a script file from being executed by remote
clients. If AccessExecute or AccessScript is set to TRUE, the script file can be executed by the Web
server. AccessNoRemoteScript is one of the access permission flags contained in the AccessFlags
property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_NO_REMOTE_READ
Metabase bitmask value 0x00001000
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 243 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
See Also
AccessFlags, AccessScript
AccessNoRemoteWrite
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property prohibits the file from being written to by remote clients.
If AccessWrite is set to TRUE, the file can be written to by the Web server. AccessNoRemoteWrite
is one of the access permission flags contained in the AccessFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_NO_REMOTE_SCRIPT
Metabase bitmask value 0x00004000
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 244 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
See Also
AccessFlags
AccessRead
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property permits the file to be read. AccessRead is one of the
access permission flags contained in the AccessFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_NO_REMOTE_WRITE
Metabase bitmask value 0x00000400
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 245 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
See Also
AccessFlags
AccessScript
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property permits an .asp file to be executed by the ASP engine.
AccessScript is one of the access permission flags contained in the AccessFlags property. The
AccessExecute property allows execution of other types of executable files in addition to .asp files.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_READ
Metabase bitmask value 0x00000001 (Default for
MD_ACCESS_PERM)
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 246 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
See Also
AccessFlags
AccessSource
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property allows the client full control over the requested
resource. Full control includes full support for the HTTP extensions provided by Web Distributed
Authoring and Versioning (WebDAV). For more information on WebDAV, see the World Wide Web
Consortium and the Internet Engineering Task Force Web sites.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_SCRIPT
Metabase bitmask value 0x00000200
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 247 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
See Also
AccessFlags
AccessSSL
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, file access requires Secure Sockets Layer (SSL) file permission processing, with or
without a client certificate. AccessSSL is one of the SSL file permission flags contained in the
AccessSSLFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_SOURCE
Metabase bitmask value 0x00000010
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 248 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_SSL_ACCESS_PERM.
See Also
AccessSSLFlags
AccessSSL128
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, file access requires Secure Sockets Layer (SSL) file permission processing with a
minimum key size of 128 bits, with or without a client certificate. AccessSSL128 is one of the SSL file
permission flags contained in the AccessSSLFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase identifier MD_SSL_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_SSL
Metabase bitmask value 0x00000008
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 249 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_SSL_ACCESS_PERM.
See Also
AccessSSLFlags
AccessSSLFlags
This is preliminary documentation for IIS 5.0 and is subject to change.
This single property contains the following Secure Sockets Layer (SSL) file permission flags:
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_SSL_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_SSL128
Metabase bitmask value 0x00000100
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
AccessSSL AccessSSLNegotiateCert
AccessSSL128 AccessSSLRequireCert
AccessSSLMapCert
Data type Long
Default value 0 (no SSL permissions)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 250 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Values
Default Value
0x00000000 (No SSL protocols required)
See Also
AccessFlags
AccessSSLMapCert
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this property indicates that Secure Sockets Layer (SSL) file permission processing
will map a client certificate to a Windows account. The AccessSSLNegotiateCert property must also
be set to TRUE for the mapping to occur. AccessSSLMapCert is one of the SSL file permission flags
contained in the AccessSSLFlags property.
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_SSL_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_SSL
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000008
Constant Value Description
MD_ACCESS_SSL 0x00000008 SSL permissions required.
MD_ACCESS_NEGO_CERT 0x00000020 Client certificate optional.
MD_ACCESS_REQUIRE_CERT 0x00000040 Client certificate required.
MD_ACCESS_MAP_CERT 0x00000080 Server will map client
certificate to Windows
account.
MD_ACCESS_SSL128 0x00000100 SSL permissions with 128-
bit key required.
Active Server Pages Guide Page 251 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_SSL_ACCESS_PERM.
See Also
AccessSSLFlags
AccessSSLNegotiateCert
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, Secure Sockets Layer (SSL) file access processing will request a certificate from
the client. If AccessSSLRequireCert is FALSE, access will continue if the client does not have a
certificate. Note that some versions of Internet Explorer will close the connection if the server requests a
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_SSL_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_MAP_CERT
Metabase bitmask value 0x00000080
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 252 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
certificate and one is not available, even if AccessSSLRequireCert is also set to TRUE.
AccessSSLNegotiateCert is one of the SSL file permission flags contained in the AccessSSLFlags
property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_SSL_ACCESS_PERM.
See Also
AccessSSLFlags
AccessSSLRequireCert
This is preliminary documentation for IIS 5.0 and is subject to change.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_SSL_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_NEGO_CERT
Metabase bitmask value 0x00000020
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 253 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
When set to TRUE, Secure Sockets Layer (SSL) file access processing will request a certificate from
the client. If no certificate is provided by the client, the connection will be closed.
AccessSSLNegotiateCert must also be set to TRUE when using AccessSSLRequireCert. This
property is one of the SSL file permission flags contained in the AccessSSLFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_SSL_ACCESS_PERM.
See Also
AccessSSLFlags
AccessWrite
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_SSL_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_REQUIRE_CERT
Metabase bitmask value 0x00000040
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 254 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to TRUE, this file permission property permits writing to the file. AccessWrite is one of the
access permission flags contained in the AccessFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_ACCESS_PERM.
See Also
AccessFlags
AdminACL
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_ACCESS_PERM
Metabase bitmask identifier MD_ACCESS_WRITE
Metabase bitmask value 0x00000002
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 255 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The AdminACL property contains a Microsoft Windows discretionary access control list (DACL) that
can be used to control access to any metabase subtree. This property can be used to grant read access,
restricted write access, or unrestricted write access.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Values
Default Value
0x00000000 (no SSL protocols required)
Data type NTACL
Default value Empty (no DACL)
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_ADMIN_ACL
Data type BINARY_METADATA
User type IIS_MD_UT_FILE
Constant Value Description
MD_ACR_READ 0x00000001 Enable read access to all
properties.
MD_ACR_WRITE 0x00000002 Enable write access to all
properties.
MD_ACR_ENUM_KEYS 0x00000008 Enable key enumeration.
MD_ACR_RESTRICTED_WRITE 0x00000020 See Remarks, following this
table.
Active Server Pages Guide Page 256 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
MD_ACR_RESTRICTED_WRITE enables write access to the following properties:
AdminServer
This is preliminary documentation for IIS 5.0 and is subject to change.
This property identifies the Web server instance being administered by the remote administration
program. This property is read-only.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
MD_ACR_UNSECURE_PROPS_READ 0x00000080 Enable read access to
properties that do not have
METADATA_SECURE
attribute set.
MD_ACR_WRITE_DAC 0x00040000 Enable write access to
AdminACL for security
descriptor creator.
AdminACL AppIsolated
Path AccessFlags
AnonymousUserName AnonymousUserPass
MaxBandWidth MaxBandWidthBlocked
SecureBindings ServerBindings
Data type String
Default value 1 (string)
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Info IIsWebInfo
Active Server Pages Guide Page 257 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AllowAnonymous
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether the FTP or Web server will allow anonymous access.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AllowKeepAlive
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether Keep-Alive processing is permitted.
Metabase identifier MD_ADMIN_INSTANCE
User type IIS_MD_UT_SERVER
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
Metabase identifier MD_ALLOW_ANONYMOUS
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 258 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AllowPathInfoForScriptMappings
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether clients are permitted to specify path information in script-mapped
requests.
Access Locations
This property is accessible at the following locations:
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_ALLOW_ANONYMOUS
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 259 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AnonymousOnly
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether the service or server restricts access to anonymous FTP users. If the
value is TRUE, only anonymous users will be allowed to log on to the FTP server. If the value is FALSE,
users will be allowed to log on by using a valid user name, as well as anonymously.
NoteIf the value of AnonymousOnly is set to TRUE, and the value of the metabase property
AllowAnonymous is set to FALSE, no users will be permitted to log on to the FTP server.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_ALLOW_PATH_INFO_FOR_SCRIPT_MAPPINGS
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
Metabase identifier MD_ANONYMOUS_ONLY
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 260 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AnonymousPasswordSync
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether IIS should handle the user password for anonymous users attempting to
access resources. For anonymous access to function properly, if the value of
AnonymousPasswordSync is FALSE the administrator must set the password in the
AnonymousUserPass property. If the value of AnonymousPasswordSync is TRUE, no anonymous
user password is required.
NoteIf the value of AnonymousPasswordSync is set to TRUE, and the value of the metabase
property AllowAnonymous is set to FALSE, no users will be permitted to log on to the FTP server.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See also
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_ANONYMOUS_USE_SUBAUTH
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 261 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AnonymousUserName, AnonymousUserPass
AnonymousUserName
This is preliminary documentation for IIS 5.0 and is subject to change.
The server associates a user name and password with every server action. This value specifies the name
of the registered local user that will be used for anonymous users. See also AnonymousUserPass and
AnonymousPasswordSync.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AnonymousUserPass
Data type String
Default value I_USR_Local machine name
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_ANONYMOUS_USER_NAME
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 262 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The server associates a user name and password with every server action. This value specifies the
password of the registered local user that will be used for anonymous users. See also
AnonymousUserName and AnonymousPasswordSync.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
AnonymousUserPass, AnonymousPasswordSync
AppAllowClientDebug
This is preliminary documentation for IIS 5.0 and is subject to change.
Data type String
Default value Random string
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_ANONYMOUS_PWD
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 263 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This flag specifies whether ASP client-side debugging is enabled. This property is independent of
AppAllowDebugging, which applies to server-side debugging.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AppAllowDebugging
This is preliminary documentation for IIS 5.0 and is subject to change.
This flag specifies whether ASP debugging is enabled on the server. This property is independent of the
AppAllowClientDebug property, which applies to client-side debugging.
TipIf server-side debugging is enabled, IIS application threads will be serialized: Only one thread at a
time will be allowed to execute, for each application. On busy sites, this could adversely affect server
performance.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_ENABLECLIENTDEBUG
Data type DWORD_METADATA
User type IIS_MD_UT_APP
Active Server Pages Guide Page 264 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AppFriendlyName
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the user-friendly name of the package or application.
Access Locations
This property is accessible at the following locations:
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_ENABLESERVERDEBUG
Data type DWORD_METADATA
User type IIS_MD_UT_WAM
Data type String
Default value Empty
Inheritance Inheritable
Active Server Pages Guide Page 265 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
AppPackageName
AppIsolated
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether an application is to run in-process, out-of-process, or in a pooled-
process. Use the application management methods of the IIsWebVirtualDir and IIsWebDirectory
objects to set the process space for your application. For more information on process pooling see IIS
Performance Features.
NoteThis property should be considered read-only.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebDirectory IIsWebDirectory
Metabase identifier MD_APP_FRIENDLY_NAME
User type IIS_MD_UT_WAM
Data type Long
Default value 2 (range 0-2)
Inheritance Inheritable
Active Server Pages Guide Page 266 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
InProcessIsapiApps
AppOopRecoverLimit
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the maximum number of times an out-of-process application will be restarted
after a failure. The server will not service requests from components that have exceeded this limit.
NoteThis property does not apply to in-process applications or extensions.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebDirectory IIsWebDirectory
Metabase identifier MD_APP_ISOLATED
Data type DWORD_METADATA
User type IIS_MD_UT_WAM
Data type Long
Default value 5 (range 1-5)
Inheritance Inheritable
Active Server Pages Guide Page 267 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
InProcessIsapiApps
AppPackageID
This is preliminary documentation for IIS 5.0 and is subject to change.
This property provides the COM+ application identifier (ID) for a transaction. This property is read-
only. This ID is used in all transactions managed by Component Services.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_APP_OOP_RECOVER_LIMIT
Data type DWORD_METADATA
User type IIS_MD_UT_APP
Data type String
Default value Empty
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
Active Server Pages Guide Page 268 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
AppPackageName
AppPackageName
This is preliminary documentation for IIS 5.0 and is subject to change.
This property provides the COM+ application name for a transaction. This property should be
considered read-only.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_APP_PACKAGE_ID
User type IIS_MD_UT_WAM
Data type String
Default value Empty string
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 269 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
AppPackageID, AppFriendlyName
AppRoot
This is preliminary documentation for IIS 5.0 and is subject to change.
This property provides the URL for the ROOT directory of the application name space. This property
should be considered read-only. To mark a node as an application root, use the application management
methods of the IIsWebVirtualDir and IIsWebDirectory objects.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AppWamClsID
Metabase identifier MD_APP_PACKAGE_NAME
User type IIS_MD_UT_WAM
Data type String
Default value Empty
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_APP_ROOT
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 270 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This property provides the class ID for the application's Web Application Management (WAM)
interface. This property should be treated as read-only.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspAllowOutOfProcComponents
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether an ASP script is allowed to call out-of-process components, which are
executables that are launched from within an application. If set to TRUE at the Web service level
(/LM/W3SVC), all in-process applications will be able to launch out-of-process components. If set to
TRUE at the root of a specific application, only that application can launch out-of-process components.
Data type String
Default value Empty
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_APP_WAM_CLSID
User type IIS_MD_UT_WAM
Data type Boolean
Default value TRUE
Inheritance Inheritable
Active Server Pages Guide Page 271 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspAllowSessionState
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables session state persistence for the ASP application. If the value is TRUE, the server
will create a new Session object for each connection. Session state will be accessible, session storage
will be allowed, the Session_OnStart and Session_OnEnd will occur, and the ASPSessionID cookie
will be sent to the client. If the value is FALSE, state access and storage are not allowed, events are not
processed, and no cookie is sent.
The @ENABLESESSIONSTATE directive can be used to override this metabase setting.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_ALLOWOUTOFPROCCOMPONENTS
Data type DWORD_METADATA
User type IIS_MD_UT_WAM
Data type Boolean
Default value TRUE
Inheritance Inheritable
Active Server Pages Guide Page 272 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspBufferingOn
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether output from an ASP application will be buffered. If the value is TRUE
(default), all output from the application is collected in the buffer before the buffer is flushed to the client
browser. If this property is set to FALSE, output from ASP scripts will be written to client browser as it
becomes available.
With buffering on, the ASP application will have to completely process the ASP script before any output
is received by the client browser. For this reason, applications for which buffering has been turned on
could seem slower to users than those applications for which buffering is turned off, even though the total
time taken for the buffered script is less. Therefore, if buffering is turned on, you should consider using
the Response.Flush method to pass the user pieces of content as the script is being processed.
NoteIf buffering is turned off, any methods that modify existing HTTP headers, or generate new
headers, must be executed before the content body is sent to the client browser. If buffering is turned on,
this restriction is unnecessary.
ImportantIf you installed IIS 5.0 by upgrading from a previous version of IIS, the default setting for
this property will be FALSE, not TRUE.
Access Locations
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_ALLOWSESSIONSTATE
User type ASP_MD_UT_APP
Data type Boolean
Default value TRUE
Inheritance Inheritable
Active Server Pages Guide Page 273 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspCodepage
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the default code page for an application. This setting can be overridden at the
page level by using the @CODEPAGE directive.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_BUFFERINGON
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Long
Default value CP_ACP (System ANSI code page)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
Active Server Pages Guide Page 274 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspEnableApplicationRestart
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property determines whether an ASP application can be automatically restarted.
There are two ways in which an application can be restarted. IIS 4.0 can call the application's Global.asa
file; this will immediately cause the application to restart if the AspEnableApplicationRestart property
is set to TRUE.
ImportantWhen this property if toggled from FALSE to TRUE, the application will automatically and
immediately be restarted.
IIS 5.0 also provides an ADSI method, AspAppRestart, which can be used to restart the application.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_CODEPAGE
User type ASP_MD_UT_APP
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 275 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
AspAppRestart
AspEnableAspHtmlFallback
This is preliminary documentation for IIS 5.0 and is subject to change.
This property is reserved for future use.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_ASP_ENABLEAPPLICATIONRESTART
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 276 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
AspAppRestart
AspEnableChunkedEncoding
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether HTTP 1.1 chunked transfer encoding is enabled for the Web
service.
NoteEven if chunked transfer encoding is enabled, it will be used only with browsers that support, and
have enabled, HTTP 1.1.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Metabase identifier MD_ASP_ENABLEAPPLICATIONRESTART
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 277 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.
AspEnableParentPaths
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether an ASP page can allow paths relative to the current directory (using
the ..\ notation). If set to TRUE, it constitutes a potential security risk because an include path could
access critical or confidential files outside the application's root directory.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_ASP_ENABLECHUNKEDENCODING
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_ENABLEPARENTPATHS
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Active Server Pages Guide Page 278 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AspEnableTypelibCache
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether type libraries will be cached on the server.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspErrorsToNTLog
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether IIS scripting errors will be written to the Windows Event Log.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_ENABLETYPELIBCACHE
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Active Server Pages Guide Page 279 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The IIsWebService setting for this property is applicable to all in-process application nodes, at all
levels. Metabase settings at the IIsWebServer level or lower will be ignored for in-process applications
unless that IIsWebServer node is isolated as an out-of-process application.
If AspLogErrorRequests is TRUE and AspErrorsToNTLog is FALSE, then the ASP errors will be
sent to the IIS log. If these errors are serious or logging to IIS log previously failed, then each error will
also be sent to the Windows Event Log.
If AspLogErrorRequests is FALSE, then these errors will only be sent to the IIS Log, and not to the
Windows Event Log.
If AspLogErrorRequests is TRUE and AspErrorsToNTLog is TRUE, then all ASP related errors
will go to the Windows Event Log and the IIS log.
NoteTo completely prevent ASP errors from being logged in the IIS log file, you must disable logging
altogether. To accomplish this see the DontLog and LogType properties.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_ERRORSTONTLOG
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Active Server Pages Guide Page 280 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AspExceptionCatchEnable
This is preliminary documentation for IIS 5.0 and is subject to change.
This value specifies whether exceptions thrown by components are trapped by ASP pages. If FALSE
(disabled), Microsoft Script Debugger will not catch exceptions sent by the component you are
debugging.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspLogErrorRequests
This is preliminary documentation for IIS 5.0 and is subject to change.
This property controls whether the Web server writes unsuccessful client requests to the Windows Event
Log file. If AspLogErrorRequests is TRUE, a standard set of ASP error requests are logged. For a list
of these errors see ASP Error List.
If AspLogErrorRequests is TRUE and AspErrorsToNTLog is FALSE, then the ASP errors will be
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_EXCEPTIONCATCHENABLE
Data type DWORD_METADATA
User type IIS_MD_UT_WAM
Active Server Pages Guide Page 281 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
sent to the IIS log. If these errors are serious or logging to IIS log previously failed, then each error will
also be sent to the Windows Event Log.
If AspLogErrorRequests is FALSE, then these errors will only be sent to the IIS Log, and not to the
Windows Event Log.
If AspLogErrorRequests is TRUE and AspErrorsToNTLog is TRUE, then all ASP related errors
will go to the Windows Event Log and the IIS log.
NoteTo completely prevent ASP errors from being logged in the IIS log file, you must disable logging
altogether. To accomplish this see the DontLog and LogType properties.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
ASP Error List
This table contains a list of ASP errors that will be logged by the Windows Event Log if
AspLogErrorRequests is set to TRUE.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_LOGERRORREQUESTS
Data type DWORD_METADATA
User type IIS_MD_UT_WAM
Active Server Pages Guide Page 282 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ASP error code ASP error Description
ASP 0100 Out of memory Unable to allocate required
memory.
ASP 0101 Unexpected error The function returned (exception
name).
ASP 0102 Expecting string input The function expects a string as
input.
ASP 0103 Expecting numeric input The function expects a number as
input.
ASP 0104 Operation not Allowed Operation not allowed.
ASP 0105 Index out of range An array index is out of range.
ASP 0106 Type Mismatch An unhandled data type was
encountered.
ASP 0107 Stack Overflow The data being processed is over
the allowed limit.
ASP 0115 Unexpected error A trappable error (exception
name) occurred in an external
object. The script cannot
continue running.
ASP 0190 Unexpected error A trappable error occurred while
releasing an external object.
ASP 0191 Unexpected error A trappable error occurred in the
OnStartPage method of an
external object.
ASP 0192 Unexpected error A trappable error occurred in the
OnEndPage method of an
external object.
ASP 0193 OnStartPage Failed An error occurred in the
OnStartPage method of an
external object.
ASP 0194 OnEndPage Failed An error occurred in the
OnEndPage method of an
external object.
ASP 0240 Script Engine Exception A script engine threw exception
(exception name) in (object
name) from (object name).
ASP 0241 CreateObject Exception The CreateObject of (object
name) caused exception
(exception name).
Active Server Pages Guide Page 283 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
AspErrorsToNTLog
AspProcessorThreadMax
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the maximum number of worker threads per processor that IIS will
create.
TipThis setting can dramatically influence the scalability of your Web applications, and the performance
of your server in general. The optimal setting for your IIS installation depends on what types of
applications and content you are serving.
If this metabase property is changed, the Web server instance must stopped and restarted in order for
the change to take effect. The Web service setting for this property is applicable to all in-process
application nodes, at all levels. Metabase settings at the Web server level or lower will be ignored for in-
process applications. However, settings at the Web server level or lower will be used if that node is
isolated as an out-of-process application.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
ASP 0242 Query OnStartPage Interface
Exception
Querying object (object name)'s
OnStartPage or OnEndPage
methods caused exception
(exception name).
Data type Long
Default value 10
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 284 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.
AspQueueConnectionTestTime
This is preliminary documentation for IIS 5.0 and is subject to change.
IIS places all ASP requests into a queue. If the request has been queued for longer than the number of
seconds specified by the AspQueueConnectionTestTime metabase property, then ASP will check to
determine whether the client is still connected before executing the request. If the client is no longer
connected, the request will not be processed, and will be deleted from the queue.
TipUsers often will not wait very long for ASP pages to be processed. Although the maximum waiting
time varies from user to user, the generally accepted maximum is approximately 10 seconds. You can
use the AspQueueConnectionTestTime metabase property to make sure that IIS does not waste time
processing a request that has been abandoned by the user.
Note that this metabase identifier is useful for making ASP processing efficient only up to the point at
which ASP begins to process the script. Once the script is being executed, however, your application
should continue to check for client connection at appropriate times during the script's execution, by using
the ASP method IResponse::IsClientConnected.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase identifier MD_ASP_PROCESSORTHREADMAX
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Long
Default value 3 seconds (range 0-0XFFFFFFFF)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 285 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspQueueTimeout
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the amount of time, in seconds, that an ASP script request will wait in the queue
for execution. When requests are pulled from the queue for execution, they are checked to see if they
have expired (have waited longer than the value of this parameter). Expired requests are rejected with a
message indicating the server is too busy.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_ASP_QUEUECONNECTIONTESTTIME
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Long
Default value -1 (no timeout)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_QUEUETIMEOUT
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Active Server Pages Guide Page 286 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AspRequestQueueMax
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the maximum number of concurrent ASP requests that will be permitted
into the queue. Any client browsers attempting to request ASP files when the queue is full will be given an
HTTP 500 "Server Too Busy" error.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspScriptEngineCacheMax
Data type Long
Default value 500 (range 0-0xFFFFFFFF)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_REQUESTQUEUEMAX
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Active Server Pages Guide Page 287 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the maximum number of scripting engines that ASP pages will keep cached in
memory.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspScriptErrorMessage
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the error message that will be sent to the browser if specific debugging errors are
not sent to the client (if AspScriptErrorSentToBrowser is FALSE).
Data type Long
Default value 50
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_SCRIPTENGINECACHEMAX
Data type DWORD_METADATA
User type IIS_MD_UT_WAM
Active Server Pages Guide Page 288 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
AspScriptErrorSentToBrowser
AspScriptErrorSentToBrowser
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether the Web server writes debugging specifics (file name, error, line number,
description) to the client browser in addition to logging them to the Windows Event Log. The
AspScriptErrorMessage property provides the error message to be sent if this property is FALSE.
Data type String
Default value An error occurred on the server when processing
the URL. Please contact the system administrator.
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_SCRIPTERRORMESSAGE
User type IIS_MD_UT_WAM
Data type Boolean
Default value TRUE
Inheritance Inheritable
Active Server Pages Guide Page 289 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
AspScriptErrorMessage
AspScriptFileCacheSize
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the number of precompiled script files to cache. If 0, no script files will be
cached. If -1, all script files requested will be cached. This property can be used to tune performance,
depending on the amount of memory available and the amount of script file traffic.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_SCRIPTERRORMESSAGE
Data type DWORD_METADATA
User type IIS_MD_UT_WAM
Data type Long
Default value 256
Inheritance Inheritable
Active Server Pages Guide Page 290 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspScriptLanguage
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the default script language for all ASP applications for the Web server. This
default language will be used within the script language delimiters (<% and %>) unless specifically
overridden by the following directive.
<%
@ LANGUAGE = ScriptingLanguage
%>
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_SCRIPTFILECACHESIZE
User type IIS_MD_UT_WAM
Data type String
Default value VBScript
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
Active Server Pages Guide Page 291 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspScriptTimeout
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the default length of time in seconds that ASP pages will allow a script to run
before terminating and writing an event to the Windows Event Log. The script can override this default
value by using the Server.ScriptTimeout property. The ScriptTimeout property allows your ASP
application to set a higher script timeout value. For example, you might use this setting to adjust the
timeout once a particular user has established a valid session by logging in or ordering a product.
NoteThe minimum value for this property is one second.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_SCRIPTLANGUAGE
User type ASP_MD_UT_APP
Data type Long
Default value 90 seconds
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 292 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See also
ScriptTimeout, AspSessionTimeout
AspSessionMax
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the maximum number of concurrent sessions that IIS will permit. If a
client attempts to establish a new session with IIS once this limit is reached, the client will receive an error
(HTTP 500 "Server Too Busy").
TipASP incurs a certain amount of memory overhead for each session maintained. Although you could
use AspSessionMax to limit this memory overhead, it is generally more appropriate to manage the
lifetime of session objects within IIS by using the AspSessionTimeout property, so that client browsers
will be rejected once the limit is reached.
If an incoming request doesn't have an ASP session cookie, or has a session cookie that doesn't match
an existing session, it is considered a new session request.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_ASP_SCRIPTTIMEOUT
User type ASP_MD_UT_APP
Data type Long
Default value -1 (maximum allowed)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 293 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See also
AspSessionTimeout
AspSessionTimeout
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the default amount of time in minutes a Session object will be maintained after the
last request associated with the object is made. This can be overridden in script by using the
Session.Timeout method.
TipAspSessionTimeout can be used to tune your ASP applications. Because Session objects
consume some memory resources, limiting the lifetime of an individual Session timeout with this property
will make your applications more scalable.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_ASP_SESSIONMAX
User type ASP_MD_UT_APP
Data type Long
Default value 10 minutes
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
Active Server Pages Guide Page 294 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See also
Timeout, AspScriptTimeout
AspThreadGateEnabled
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property indicates whether IIS thread gating is enabled.
ImportantIIS performs thread gating to dynamically control the number of concurrently executing
threads, in response to varying load conditions. The default settings for this property, and the other
thread gating properties, are designed to be appropriate for the majority of server configurations and
traffic conditions. Changing these properties can lead to significant performance degradation.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_SESSIONTIMEOUT
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
Active Server Pages Guide Page 295 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspThreadGateLoadHigh
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the minimum CPU load, as a percentage of the total, at which the CPU
is considered under high load conditions. This information will be used by IIS to perform thread gating, in
an attempt to maintain CPU load between the percentages specified in AspThreadGateLoadLow and
AspThreadGateLoadHigh.
ImportantIIS performs thread gating to dynamically control the number of concurrently executing
threads, in response to varying load conditions. The default settings for this property, and the other
thread gating properties, are designed to be appropriate for the majority of server configurations and
traffic conditions. Changing these properties can lead to significant performance degradation.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_THREADGATEENABLED
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Long
Default value 90 percent
Inheritance Inheritable
Active Server Pages Guide Page 296 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspThreadGateLoadLow
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the maximum CPU load, as a percentage of the total, at which the CPU
is still considered under low load conditions. This information will be used by IIS to perform thread
gating, in an attempt to maintain CPU load between the percentages specified in
AspThreadGateLoadLow and AspThreadGateLoadHigh.
ImportantIIS performs thread gating to dynamically control the number of concurrently executing
threads, in response to varying load conditions. The default settings for this property, and the other
thread gating properties, are designed to be appropriate for the majority of server configurations and
traffic conditions. Changing these properties can lead to significant performance degradation.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_THREADGATELOADHIGH
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Long
Default value 75 percent
Inheritance Inheritable
Active Server Pages Guide Page 297 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspThreadGateSleepDelay
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies how long to defer thread requests, before the request is rechecked by
the IIS thread gating mechanism.
ImportantIIS performs thread gating to dynamically control the number of concurrently executing
threads, in response to varying load conditions. The default settings for this property, and the other
thread gating properties, are designed to be appropriate for the majority of server configurations and
traffic conditions. Changing these properties can lead to significant performance degradation.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_THREADGATELOADLOW
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Long
Default value 100 milliseconds
Inheritance Inheritable
Active Server Pages Guide Page 298 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspThreadGateSleepMax
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the maximum number of times a specific request can be put to sleep
(deferred) while IIS performs thread gating.
ImportantIIS performs thread gating to dynamically control the number of concurrently executing
threads, in response to varying load conditions. The default settings for this property, and the other
thread gating properties, are designed to be appropriate for the majority of server configurations and
traffic conditions. Changing these properties can lead to significant performance degradation.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_THREADGATESLEEPDELAY
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Long
Default value 50
Inheritance Inheritable
Active Server Pages Guide Page 299 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspThreadGateTimeSlice
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies how often the thread gating mechanism in IIS checks the CPU load.
ImportantIIS performs thread gating to dynamically control the number of concurrently executing
threads, in response to varying load conditions. The default settings for this property, and the other
thread gating properties, are designed to be appropriate for the majority of server configurations and
traffic conditions. Changing these properties can lead to significant performance degradation.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_THREADGATESLEEPMAX
User type ASP_MD_UT_APP
Data type Long
Default value 1000 milliseconds
Inheritance Inheritable
Active Server Pages Guide Page 300 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AspTrackThreadingModel
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether IIS will check the threading model of any components that
your application instantiates.
ImportantIt is usually best to leave this metabase property set to its default value (FALSE), so that
ASP will not use system resources to track the threading model. and your ASP application will usually
provide the best possible performance. If this property is set to FALSE, and you give Application scope
to components that you create, those components must aggregate the free-threaded marshaler. If you do
not aggregate the free-threaded marshaler, ASP will generate an error when you try to instantiate the
component. For more information about this topic, see Building Components for ASP.
TipAnother reason to leave this property at its default setting (FALSE), is that any objects instantiated
in your ASP application that lack the OnStartPage or OnEndPage method will be released earlier than
they would be otherwise. This should improve your application's scalability.
For more details on improving performance, see Developing Scalable ASP Applications.
NoteIn IIS 4.0, the default for this metabase property was TRUE.
The Web service setting for this property is applicable to all in-process application nodes, at all levels.
Metabase settings at the Web server level or lower will be ignored for in-process applications. However,
settings at the Web server level or lower will be used if that node is isolated as an out-of-process
application.
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_THREADGATETIMESLICE
User type ASP_MD_UT_APP
Active Server Pages Guide Page 301 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
AuthAnonymous
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies anonymous authentication as one of the possible Windows authentication
schemes returned to clients as being available. AuthAnonymous is one of the authentication scheme
flags contained in the AuthFlags property.
Access Locations
This property is accessible at the following locations:
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_ASP_TRACKTHREADINGMODEL
Data type DWORD_METADATA
User type ASP_MD_UT_APP
Data type Boolean
Default value TRUE
Inheritance Inheritable
Active Server Pages Guide Page 302 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_AUTHORIZATION.
See Also
AuthFlags
AuthBasic
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies Basic authentication as one of the possible Windows authentication schemes
returned to clients as being available. AuthBasic is one of the authentication scheme flags contained in
the AuthFlags property.
Access Locations
This property is accessible at the following locations:
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_AUTHORIZATION
Metabase bitmask identifier MD_AUTH_ANONYMOUS
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000001
Data type Boolean
Default value FALSE
Inheritance Inheritable
Active Server Pages Guide Page 303 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_AUTHORIZATION.
See Also
AuthFlags
AuthFlags
This is preliminary documentation for IIS 5.0 and is subject to change.
This single property contains the settings for the Windows authentication schemes that will be returned to
clients as being available.
This single property contains the following file access permission flags:
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_AUTHORIZATION
Metabase bitmask identifier MD_AUTH_BASIC
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000002
Authanonymous
AuthBasic
AuthNTLM
Active Server Pages Guide Page 304 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
AuthNTLM
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies integrated Windows authentication (also known as Challenge/Response or
Data type Long
Default value AuthAnonymous = TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_AUTHORIZATION
User type IIS_MD_UT_FILE
Default bitmask setting MD_AUTH_ANONYMOUS
Constant Value Description
MD_AUTH_ANONYMOUS 0x00000001 Anonymous authentication
available.
MD_AUTH_BASIC 0x00000002 Basic authentication available.
MD_AUTH_NT 0x00000004 Windows authentication schemes
available.
Active Server Pages Guide Page 305 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
NTLM authentication) as one of the possible Windows authentication schemes returned to clients as
being available. AuthNTLM is one of the authentication scheme flags contained in the AuthFlags
property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_AUTHORIZATION.
See Also
AuthFlags
AuthPersistence
This is preliminary documentation for IIS 5.0 and is subject to change.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_AUTHORIZATION
Metabase bitmask identifier MD_AUTH_NT
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000004
Active Server Pages Guide Page 306 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property specifies authentication persistence across requests on a connection. It is recommended
that you set this property by setting the corresponding subflag to TRUE, which will automatically set a
binary value for AuthPersistence.
If the AuthPersistSingleRequest is set to TRUE, then authentication persists only for a single request.
If AuthPersistSingleRequestIfProxy is set to TRUE, then authentication persists only for a single
request if it is a proxy request and the request is not handled by Microsoft Proxy Server. (That is, if
Proxy Server and IIS are running on the local computer, and the request is targeted to a remote server.)
If AuthPersistSingleRequestAlwaysIfProxy is set to TRUE, then authentication is valid for a single
request if the request is by proxy.
NoteOnly one sub-flag of AuthPersistence can be TRUE at one time. The subflags are
AuthPersistSingleRequest, AuthPersistSingleRequestIfProxy, and
AuthPersistSingleRequestAlwaysIfProxy. When one of these three properties is set to TRUE, the
other two properties are automatically set to FALSE. The value of AuthPersistence always equals the
value of the sub-flag that is set to TRUE.
This single property contains the following file access permission flags. All permissions are applicable to
the Web service, servers, directories, and files. Only the AccessRead and AccessWrite permissions
are applicable for the FTP service, FTP servers, and FTP directories.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Data type Long
Default value &H00000080 (or
AuthPersistSingleRequestIfProxy=TRUE)
Inheritance Inheritable
AuthPersistSingleRequest AuthPersistSingleRequestAlwaysIfProxy
AuthPersistSingleRequestIfProxy
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 307 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
AuthPersistSingleRequest
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies authentication will persist only across single requests on a connection. IIS will
reset the authentication at the end of each request, and force re-authentication on the next request of the
session.
Metabase identifier MD_AUTHORIZATION_PERSISTENCE
User type IIS_MD_UT_FILE
Default bitmask setting MD_AUTH_SINGLEREQUESTIFPROXY
Constant Value Description
MD_AUTH_SINGLEREQUEST 0x00000040 Authentication is valid for
a single request. IIS will
reset the authentication at
the end of the request,
and force re-
authentication on the next
request of the session.
MD_AUTH_SINGLEREQUESTIFPROXY 0x00000080 Authentication is valid for
a single request. IIS will
reset the authentication at
the end of the request if
the current authenticated
request is by proxy, and it
is not the special case
where IIS is running
MSPROXY.
MD_AUTH_SINGLEREQUESTALWAYSIFPROXY 0x00000100 Authentication is valid for
a single request. IIS will
reset the authentication at
the end of the request and
force re-authentication on
the next request if the
current authenticated
request is by any type of
proxy.
Active Server Pages Guide Page 308 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AuthPersistSingleRequest is one of the authentication scheme flags contained in the AuthPersistence
property.
All permissions are applicable to the Web service, servers, directories, and files. Only the AccessRead
and AccessWrite permissions are applicable for the FTP service, FTP servers, and FTP directories.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_AUTHORIZATION.
See Also
AuthPersistence
AuthPersistSingleRequestIfProxy
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_AUTHORIZATION_PERSISTENCE
Metabase bitmask identifier MD_AUTH_SINGLEREQUEST
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000040
Active Server Pages Guide Page 309 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies authentication will persist only across single requests on a connection if the
connection is by proxy. IIS will reset the authentication at the end of the request if the current
authenticated request is by proxy and it is not the special case where IIS is running MSPROXY.
AuthPersistSingleRequestIfProxy is one of the authentication scheme flags contained in the
AuthPersistence property.
All permissions are applicable to the Web service, servers, directories, and files. Only the AccessRead
and AccessWrite permissions are applicable for the FTP service, FTP servers, and FTP directories.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_AUTHORIZATION.
See Also
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_AUTHORIZATION_PERSISTENCE
Metabase bitmask identifier MD_AUTH_SINGLEREQUESTIFPROXY
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000080
Active Server Pages Guide Page 310 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AuthPersistence
AuthPersistSingleRequestAlwaysIfProxy
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that authentication is valid for a single request if by proxy. IIS will reset the
authentication at the end of the request and force re-authentication on the next request if the current
authenticated request is by proxy of any type.
AuthPersistSingleRequestAlwaysIfProxy is one of the authentication scheme flags contained in the
AuthPersistence property.
All permissions are applicable to the Web service, servers, directories, and files. Only the AccessRead
and AccessWrite permissions are applicable for the FTP service, FTP servers, and FTP directories.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_AUTHORIZATION.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 311 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
AuthPersistence
CacheControlCustom
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies custom HTTP 1.1 cache control directives. Multiple directives can be specified if
they are separated by carriage return/line feed (CRLF) pairs. There should not be a trailing carriage
return/line feed after the final directive.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_AUTHORIZATION_PERSISTENCE
Metabase bitmask identifier MD_AUTH_SINGLEREQUESTALWAYSIFPROXY
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000100
Data type String
Default value Empty
By default, this property is not set and cache
control directives are not sent
Inheritance Inheritable
Metabase Path IIS Admin Object Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 312 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CacheControlMaxAge
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the HTTP 1.1 cache control maximum age value. The range is 0 to
&HFFFFFFFF (-1 or unlimited) , measured in seconds.
Note&H represents VBScript hexadecimal format.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_CC_OTHER
User type IIS_MD_UT_FILE
Data type Long
Default value Empty
By default, this property is not set and cache
control directives are not sent
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_MD_CC_MAX_AGE
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 313 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CacheControlNoCache
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the HTTP 1.1 directive to prevent caching of content.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CacheISAPI
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether ISAPI extensions are cached in memory after use. If the value of this
property is TRUE, the .dll file will remain in the cache until the server is stopped. If the value is FALSE,
Data type Boolean
Default value FALSE
By default, this property is not set and cache
control directives are not sent
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_CC_NO_CACHE
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 314 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
extensions are unloaded from memory once the extension .dll is no longer in use.
ISAPI extensions are cached or not cached based on the value of this property at the time they were
loaded into memory for use. Thus, if this property is changed after an extension has been loaded and
cached, the change will have no effect on that extension.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CertCheckMode
This is preliminary documentation for IIS 5.0 and is subject to change.
This property is used to enable or disable Certificate Revocation List (CRL) checking. When
CertCheckMode is set to zero (0) the CRL is not searched for certificates that have been revoked.
When CertCheckMode is greater than zero (CertCheckMode>0) the CRL will be searched for
certificates that have been revoked.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC/1 IIsWebServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_CACHE_EXTENSIONS
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Active Server Pages Guide Page 315 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CGITimeout
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the timeout in seconds for CGI applications. Its range is 10 to &H80000000 (2.1
million seconds).
Note&H represents VBScript hexadecimal format.
Access Locations
This property is accessible at the following locations:
Data Type Integer
Default Value 0
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase Property MD_CERT_CHECK_MODE
User Type IIS_MD_UT_SERVER
Data type Long
Default value 300 seconds
Inheritance Inheritable
Active Server Pages Guide Page 316 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
ConnectionTimeout
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the time in seconds the server will wait before disconnecting an inactive
connection.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_SCRIPT_TIMEOUT
User type IIS_MD_UT_FILE
Data type Long
Default value 900 (15 minutes)
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 317 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
ContentIndexed
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether the content under this directory tree should be indexed by the installed
content indexer.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CpuAppEnabled
Metabase identifier MD_CONNECTION_TIMEOUT
User type IIS_MD_UT_SERVER
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_CONNECTION_TIMEOUT
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 318 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether process accounting and throttling should be performed for
ISAPI extensions and ASP applications. To perform process accounting on CGI applications, use the
property CpuCgiEnabled.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, CpuLimitPause.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 319 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CpuCgiEnabled
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property indicates whether IIS should perform process accounting for CGI applications.
To effectively throttle CGI applications, use the CgiTimeout property. To use process accounting for
ISAPI and ASP applications, use CpuAppEnabled.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, CpuLimitPause.
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_CPU_APP_ENABLED
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 320 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CpuCgiLimit
This is preliminary documentation for IIS 5.0 and is subject to change.
When set to a value other than zero, this property limits the time in seconds that a CGI script is allowed
to be in process. When set to zero, the process time is unlimited.
NoteCpuCgiLimit requires either CpuLimitsEnabled or CpuLoggingOptions set to TRUE.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_CPU_CGI_ENABLED
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Integer
Default value 0 (zero)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_CGI_LIMIT
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 321 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ScriptTimeout
CpuEnableActiveProcs
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the total number of active processes is recorded when process
accounting is performed.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
See Also
CpuLoggingMask
CpuEnableAllProcLogging
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_ACTIVE_PROCS
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000040
Active Server Pages Guide Page 322 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether IIS should log total CPU times for all out-of-process ISAPI extensions
and ASP and CGI applications. For more information, see CpuLoggingOptions.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_OPTIONS.
See Also
CpuLoggingOptions
CpuEnableAppLogging
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether IIS should log out-of-process ISAPI extensions and ASP applications.
For more information, see CpuLoggingOptions.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LOGGING_OPTIONS
Metabase bitmask identifier MD_CPU_ENABLE_ALL_PROC_LOGGING
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000001
Active Server Pages Guide Page 323 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_OPTIONS.
See Also
CpuLoggingOptions
CpuEnableCgiLogging
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether IIS should log total CPU times for CGI applications. For more
information, see CpuLoggingOptions.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LOGGING_OPTIONS
Metabase bitmask identifier MD_CPU_ENABLE_APP_LOGGING
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000004
Data type Boolean
Default value FALSE
Inheritance Inheritable
Active Server Pages Guide Page 324 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_OPTIONS.
See Also
CpuLoggingOptions
CpuEnableEvent
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the event that triggered the creation of a log record is specified in the log
record itself. For more information, see CpuLoggingMask.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LOGGING_OPTIONS
Metabase bitmask identifier MD_CPU_ENABLE_CGI_LOGGING
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000002
Data type Boolean
Default value TRUE
Inheritance Inheritable
Active Server Pages Guide Page 325 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
See Also
CpuLoggingMask
CpuEnableKernelTime
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether total kernel-mode CPU time is recorded when process accounting is
performed. For more information, see CpuLoggingMask.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_EVENT
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000001
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 326 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
See Also
CpuLoggingMask
CpuEnableLogging
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether process accounting is enabled for the Web service or server. Process
accounting can log the amount of CPU time that is taken by a Web server or service, as well as any
process throttling events that might occur. For more information, see CpuLoggingMask.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_KERNEL_TIME
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000008
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 327 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
See Also
CpuLoggingMask
CpuEnablePageFaults
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the total number of page faults is recorded when process accounting is
performed. For more information, see CpuLoggingMask.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_LOGGING
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x80000000
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 328 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
CpuLoggingMask
CpuEnableProcType
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether process type is recorded when process accounting is performed. For
more information, see CpuLoggingMask.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_PAGE_FAULTS
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000010
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 329 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
CpuLoggingMask
CpuEnableTerminatedProcs
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the total number of terminated processes is recorded when process
accounting is performed. For more information, see CpuLoggingMask.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_PROC_TYPE
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000002
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 330 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
CpuLoggingMask
CpuEnableTotalProcs
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the total number of processes is recorded when process accounting is
performed. For more information, see CpuLoggingMask.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_TERMINATED_PROCS
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000080
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 331 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
CpuLoggingMask
CpuEnableUserTime
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether total user-mode CPU time is recorded when process accounting is
performed. For more information, see CpuLoggingMask.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_CPU_LOGGING_MASK.
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_TOTAL_PROCS
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000020
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 332 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
CpuLoggingMask
CpuLimitLogEvent
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the percentage of CPU time, in 1/1000ths of a percent, that all isolated
processes on the Web server are allowed to occupy during a given process accounting interval (specified
by CpuResetInterval). If the processes attempt to occupy more CPU time than specified in
CpuLimitLogEvent, a note will be made in the Windows Event Log that the processes have exceeded
the limits. If process accounting is enabled, the limit overrun will also be entered into the IIS log.
If CpuLimitLogEvent is set to 0, or a value greater than 100,000 (100 percent), IIS will not log any
events against the process. However, one of the other process throttling properties, such as
CpuLimitPriority, CpuLimitProcStop, or CpuLimitPause, could generate a response from IIS if a
CPU limit is exceeded.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting, you must set CpuEnableLogging (which is a
member of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to
TRUE. It is also necessary to set at least one flag of CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, or CpuLimitPause.
ImportantApplications that do not have process throttling enabled do not contribute to the total CPU
time for the purposes of calculating CPU limit overruns.
Metabase identifier MD_CPU_LOGGING_MASK
Metabase bitmask identifier MD_CPU_ENABLE_USER_TIME
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000004
Active Server Pages Guide Page 333 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CpuLimitPause
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the percentage of CPU time, in 1/1000ths of a percent, that all isolated
processes on the Web server can occupy during a given process accounting interval (specified by
CpuResetInterval). If the processes attempt to occupy more CPU time than specified in
CpuLimitPause, IIS will pause the entire site, and any new client requests will receive a custom error
indicating that the server is out of resources. The site will remain in a paused state until the current reset
interval has ended. Any limit overrun will be recorded in the Windows Event Log, and, if process
accounting is enabled, in the IIS log as well.
If CpuLimitPause is set to 0, or a value greater than 100,000 (100 percent), IIS will not pause the site.
However, one of the other process throttling properties, such as CpuLimitLogEvent,
CpuLimitPriority, or CpuLimitProcStop, could generate a response from IIS if a CPU limit is
exceeded.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
Data type Long
Default value 0 (unlimited)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LIMIT_LOGEVENT
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 334 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, or CpuLimitPause.
ImportantApplications that do not have process throttling enabled do not contribute to the total CPU
time for the purposes of calculating CPU limit overruns.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CpuLimitPriority
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the percentage of CPU time, in 1/1000ths of a percent, that all isolated
processes on the Web server can occupy during a given process accounting interval (specified by
CpuResetInterval). If the processes attempt to occupy more CPU time than specified in
CpuLimitPriority, all processes for that server will be set to Idle Class priority until the next process
accounting reset. Any new processes on that server will also be set to Idle Class priority. Any limit
overrun will be recorded in the Windows Event Log, and, if process accounting is enabled, in the IIS log
as well.
If CpuLimitPriority is set to 0, or a value greater than 100,000 (100 percent), IIS will take change the
priority of any of the process' threads. However, one of the other process throttling properties, such as
CpuLimitLogEvent, CpuLimitProcStop, or CpuLimitPause, could generate a response from IIS if a
Data type Long
Default value 0 (unlimited)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LIMIT_PAUSE
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 335 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CPU limit is exceeded.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, or CpuLimitPause.
ImportantApplications that do not have process throttling enabled do not contribute to the total CPU
time, for the purposes of calculating CPU limit overruns.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CpuLimitProcStop
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the percentage of CPU time, in 1/1000ths of a percent, that all isolated
processes on the Web server may occupy during a given process accounting interval (specified by
Data type Long
Default value 0 (unlimited)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LIMIT_PRIORITY
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 336 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CpuResetInterval). If the isolated processes attempt to occupy more CPU time than specified in
CpuLimitProcStop, IIS halts all isolated processes on that site affected by Process Throttling.
Processes terminated due to limit overruns will not be allowed to restart until the next CPU interval reset.
Any limit overrun will be recorded in the Windows Event Log, and, if process accounting is enabled, in
the IIS log as well.
If CpuLimitProcStop is set to 0, or a value greater than 100,000 (100 percent), IIS will not stop the
process. However, one of the other process throttling properties, such as CpuLimitLogEvent,
CpuLimitPriority, or CpuLimitPause, could generate a response from IIS if a CPU limit is exceeded.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority, or
CpuLimitProcStop, CpuLimitPause.
ImportantApplications that do not have process throttling enabled do not contribute to the total CPU
time, for the purposes of calculating CPU limit overruns.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Data type Long
Default value 0 (unlimited)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LIMIT_PROCSTOP
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 337 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CpuLimitsEnabled
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether process throttling is enabled, Process throttling can be enabled
for an individual virtual server, or for the Web service overall, to limit the amount of CPU time used.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and accounting are independently controlled by several other metabase properties. In
order to enable process accounting you must set CpuEnableLogging (which is a member of
CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, or CpuLimitPause.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LIMITS_ENABLED
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 338 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CpuLoggingInterval
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the logging interval for process accounting and throttling activity, in
minutes. If process accounting is enabled and activated, IIS will write a summary of the process
accounting information to the log file at the end of each interval specified by CpuLoggingInterval.
ImportantFor process accounting to work properly, you must be sure to set the property
CpuLoggingInterval to a value less than that specified by CpuResetInterval. If
CpuLoggingInterval is greater than CpuResetInterval, IIS will reset counters and the logging timer
before the logging interval has elapsed, and process accounting will never occur.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority, or
CpuLimitProcStop, CpuLimitPause.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Data type Long
Default value 60 minutes (1 minute minimum)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 339 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CpuLoggingMask
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies which process accounting and throttling fields should be written to the
IIS log file. All enabled fields will be written on every process accounting log. All values logged are for
the reset interval in which the logging occurs.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
This property contains the following flags:
You can also change the logging mask flags by directly manipulating the flags contained in
CpuLoggingMask by using the hexadecimal values described in the following tables.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set to a nonzero value, and
set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, or CpuLimitPause.
Access Locations
Metabase identifier MD_CPU_LOGGING_INTERVAL
User type IIS_MD_UT_SERVER
CpuEnableLogging CpuEnableProcType
CpuEnableActiveProcs CpuEnableTerminatedProcs
CpuEnableEvent CpuEnableTotalProcs
CpuEnableKernelTime CpuEnableUserTime
CpuEnablePageFaults
Data type Long
Default value All Member Flags = TRUE
Inheritance Inheritable
Active Server Pages Guide Page 340 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LOGGING_MASK
User type IIS_MD_UT_SERVER
Default bitmask setting
NoteMultiple bits are set by default.
MD_CPU_ENABLE_LOGGING
MD_CPU_ENABLE_EVENT
MD_CPU_ENABLE_PROC_TYPE
MD_CPU_ENABLE_USER_TIME
MD_CPU_ENABLE_KERNEL_TIME
MD_CPU_ENABLE_PAGE_FAULTS
MD_CPU_ENABLE_TOTAL_PROCS
MD_CPU_ENABLE_ACTIVE_PROCS
MD_CPU_ENABLE_TERMINATED_PROCS
Default bitmask value 0x800000FF
Constant Value Description
MD_CPU_ENABLE_LOGGING 0x80000000 Specifies whether process
accounting is enabled.
MD_CPU_ENABLE_EVENT 0x00000001 Log site events, such as start,
stop, and site process
throttling.
MD_CPU_ENABLE_PROC_TYPE 0x00000002 Log the process type.
Active Server Pages Guide Page 341 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CpuLoggingOptions
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property contains flags that specify how IIS should log CPU times for services, servers,
or applications. You can use this property to configure IIS to sum the CPU times of CGI applications
only, of ISAPI extensions and ASP applications only, or of all applications.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
You can also directly manipulate the bit flags within CpuLoggingOptions by using the hexadecimal
values in the following Bitmask Values table.
Process throttling and process accounting are independently controlled by several other metabase
properties. In order to enable process accounting you must set CpuEnableLogging (which is a member
of CpuLoggingMask) to TRUE, and set at least one other CpuLoggingMask property to TRUE. It is
also necessary to set at least one member flag of the CpuLoggingOptions, set CpuLoggingInterval to
a nonzero value, and set either CpuAppEnabled or CpuCgiEnabled, as appropriate, to TRUE.
To properly activate process throttling, CpuLimitsEnabled must be set to TRUE, and at least one of
MD_CPU_ENABLE_USER_TIME 0x00000004 Log the total user CPU time,
as a percentage of total CPU
time, in 1/1000ths of a
percent.
MD_CPU_ENABLE_KERNEL_TIME 0x00000008 Log the total kernel CPU
time, as a percentage of total
CPU time, in 1/1000ths of a
percent.
MD_CPU_ENABLE_PAGE_FAULTS 0x00000010 Log the total number of page
faults.
MD_CPU_ENABLE_TOTAL_PROCS 0x00000020 Log the total number of
processes.
MD_CPU_ENABLE_ACTIVE_PROCS 0x00000040 Log the total number of active
processes.
MD_CPU_ENABLE_TERMINATED_PROCS 0x00000080 Log the total number of
terminated processes.
Data type Long
Default value 1
Inheritance Inheritable
Active Server Pages Guide Page 342 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
the following properties should be set to TRUE: CpuLimitLogEvent, CpuLimitPriority,
CpuLimitProcStop, or CpuLimitPause.
This property contains the following flags:
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
CpuResetInterval
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the reset period for process accounting and process throttling limits on
the server or service. When the number of minutes elapsed since the last process accounting reset equals
CpuEnableAppLogging CpuEnableAllProcLogging
CpuEnableCgiLogging
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_LOGGING_OPTIONS
User type IIS_MD_UT_SERVER
Default bitmask setting MD_CPU_ENABLE_ALL_PROC_LOGGING
Constant Value Description
MD_CPU_DISABLE_ALL_LOGGING 0x00000000 Do not log CPU information.
MD_CPU_ENABLE_ALL_PROC_LOGGING 0x00000001 Log the sum of CPU time
used by applications and CGI.
MD_CPU_ENABLE_CGI_LOGGING 0x00000002 Log the CPU time used by
CGI applications.
MD_CPU_ENABLE_APP_LOGGING 0x00000004 Log the CPU time used by
ISAPI and ASP applications.
Active Server Pages Guide Page 343 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
the number specified by this property, IIS will reset the CPU timers for both the logging and limit
intervals.
ImportantIf you want IIS to log process accounting information to a log file, you must be sure to set
the property CpuLoggingInterval to a value less than that specified by CpuResetInterval. If
CpuLoggingInterval is greater than CpuResetInterval, IIS will reset counters and the logging timer
before the logging interval has elapsed, and process accounting will never occur.
NoteBecause process accounting in IIS uses Windows Job Objects to monitor CPU times for an
entire process, process accounting will log and throttle only applications that are isolated in a separate
process from IIS.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CreateCGIWithNewConsole
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether a CGI application runs in its own console. If the value is TRUE, each
CGI application creates a new console when started. A value of FALSE indicates that CGI applications
should run without a console.
Data type Long
Default value 1440 minutes (24 hours)
(1 minute minimum)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_CPU_RESET_INTERVAL
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 344 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CreateProcessAsUser
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether a CGI process will be created in the system context or in the context of
the requesting user.
Access Locations
This property is accessible at the following locations:
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_CREATE_PROC_NEW_CONSOLE
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value TRUE
Inheritance Inheritable
Active Server Pages Guide Page 345 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
CustomErrorDescriptions
This is preliminary documentation for IIS 5.0 and is subject to change.
This property contains a list of custom error messages. Each string in the list specifies an error code and
subcode for the custom message; what the specific error text and subcode error text is to be; and
whether the custom message is supported by file or URL, or just by file only. Each string is in the format
ErrorCode, ErrorSubcode, ErrorText, ErrorSubcodeText, followed by another comma and either a 0
for file and URL support, or a 1 for file support only.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_CREATE_PROCESS_AS_USER
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type List (string)
Default value Empty list
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/INFO IIsWebInfo
Active Server Pages Guide Page 346 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
HttpErrors
DefaultDoc
This is preliminary documentation for IIS 5.0 and is subject to change.
This property contains one or more file names of default documents that will be returned to the client if no
file name is included in the client's request. The default document will be returned if the
EnableDefaultDoc property is TRUE for the directory. This property can contain a list of default
document file names separated by a comma and a space, for example Default1.htm, Default2.htm.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_CUSTOM_ERROR_DESC
Data type MULTISZ_METADATA
User type IIS_MD_UT_SERVER
Data type String
Default value Default.htm
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 347 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
If the EnableDefaultDoc flag is not set in the DirBrowseFlags property, the server will not search for
a default document.
See Also
DirBrowseFlags
DefaultDocFooter
This is preliminary documentation for IIS 5.0 and is subject to change.
This value specifies the custom footer that is appended to files returned to the client. The custom footer
will be sent only if the EnableDocFooter property is TRUE. The footer can be a string such as "This is a
custom footer," or a reference to a file such as C:\Wwwroot\Footers\Footer.htm.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_DEFAULT_LOAD_FILE
User type IIS_MD_UT_FILE
Data type String
Default value Empty string
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 348 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
If the EnableDefaultDoc flag is not set in the DirBrowseFlags identifier, the server will not search for
a default document.
See Also
EnableDocFooter
DefaultLogonDomain
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the default domain for logon. If this value is not specified, the default domain will
be the domain name controlled by the computer, if the computer is a domain controller. If the computer
is not a domain controller, the default domain will be the computer name.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Metabase identifier MD_FOOTER_DOCUMENT
User type IIS_MD_UT_FILE
Data type String
Default value Empty string
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 349 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.
DirBrowseFlags
This is preliminary documentation for IIS 5.0 and is subject to change.
This property contains flags that control whether directory browsing is enabled, how much directory and
file information is provided if browsing is enabled, and whether there is a default page in the directory.
NoteIf a client accesses the directory and does not provide a file name, and the EnableDefaultDoc
flag is set to TRUE, the server will look for the file specified in the property DefaultDoc. If the default
file does not exist in the directory, and the EnableDirBrowsing flag is set to TRUE, then directory
browsing is enabled.
This property contains the following directory browsing flags:
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_DEFAULT_LOGON_DOMAIN
User type IIS_MD_UT_FILE
Data type Long
Default value DirBrowseShowDate,
DirBrowseShowExtension,
DirBrowseShowSize, DirBrowseShowTime,
EnableDefaultDoc
Inheritance Inheritable
DirBrowseShowDate DirBrowseShowTime
DirBrowseShowExtension EnableDefaultDoc
DirBrowseShowLongDate EnableDirBrowsing
DirBrowseShowSize
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
Active Server Pages Guide Page 350 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
DirBrowseShowDate
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that date information will be displayed when browsing directories.
DirBrowseShowDate is one of the settings contained in the DirBrowseFlags property.
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_DIRECTORY_BROWSING
User type IIS_MD_UT_FILE
Default bitmask setting MD_DIRBROW_SHOW_DATE
MD_DIRBROW_SHOW_TIME
MD_DIRBROW_SHOW_SIZE
MD_DIRBROW_SHOW_EXTENSION
MD_DIRBROW_LOADDEFAULT
Default bitmask value 0x4000001E
Constant Value Description
MD_DIRBROW_SHOW_DATE 0x00000002 Show date.
MD_DIRBROW_SHOW_TIME 0x00000004 Show time.
MD_DIRBROW_SHOW_SIZE 0x00000008 Show file size.
MD_DIRBROW_SHOW_EXTENSION 0x00000010 Show file name extension.
MD_DIRBROW_LONG_DATE 0x00000020 Show full date.
MD_DIRBROW_LOADDEFAULT 0x40000000 Load default page, if it exists.
MD_DIRBROW_ENABLED 0x80000000 Enable directory browsing.
Active Server Pages Guide Page 351 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
See Also
DirBrowseFlags
DirBrowseShowExtension
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that file name extensions will be displayed when browsing directories.
DirBrowseShowExtension is one of the settings contained in the DirBrowseFlags property.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_DIRECTORY_BROWSING
Metabase bitmask identifier MD_DIRBROW_SHOW_DATE
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000002
Active Server Pages Guide Page 352 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
See Also
DirBrowseFlags
DirBrowseShowLongDate
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that date information will be displayed in extended format when displaying
directories. DirBrowseShowLongDate is one of the settings contained in the DirBrowseFlags
property.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_DIRECTORY_BROWSING
Metabase bitmask identifier MD_DIRBROW_SHOW_EXTENSION
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000010
Active Server Pages Guide Page 353 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
See Also
DirBrowseFlags
DirBrowseShowSize
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that file size information will be displayed when browsing directories.
DirBrowseShowSize is one of the settings contained in the DirBrowseFlags property.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_DIRECTORY_BROWSING
Metabase bitmask identifier MD_DIRBROW_LONG_DATE
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000020
Active Server Pages Guide Page 354 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
See Also
DirBrowseFlags
DirBrowseShowTime
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that file time information will be displayed when displaying directories.
DirBrowseShowTime is one of the settings contained in the DirBrowseFlags property.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_DIRECTORY_BROWSING
Metabase bitmask identifier MD_DIRBROW_SHOW_SIZE
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000008
Active Server Pages Guide Page 355 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
See Also
DirBrowseFlags
DirectoryLevelsToScan
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the number of virtual directory levels to scan in the metabase from the top of the
tree (that is, the root virtual directory for a server) to build a list of directories to be monitored for file
system changes. The valid range is 0 to 0xFFFFFFFF (unlimited). If a virtual directory is not included in
the list, then the IIS cache will not be flushed when a file change occurs in the directory. This list is also
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_DIRECTORY_BROWSING
Metabase bitmask identifier MD_DIRBROW_SHOW_TIME
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x00000004
Active Server Pages Guide Page 356 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
used for down-level remote administration from earlier versions of IIS.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
DisableSocketPooling
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether socket pooling is used for sites distinguished by IP address (rather than
port number or host header name, for example). If DisableSocketPooling is set to FALSE, then socket
pooling is enabled and sockets are shared between sites that use the same socket number (but different
IP addresses). If DisableSocketPooling is set to TRUE, then there is no socket sharing for sites based
on IP address.
NoteSocket pooling is a new feature in IIS 5.0.
In IIS version 4.0, each Web site was bound to a different IP address, which meant that each site had its
own socket that was not shared with sites bound to other IP addresses. These sockets are created when
the site starts, and they consume significant nonpaged memory (RAM). This memory consumption limits
the number of sites bound to IP addresses that can be created on a single machine.
By default, socket pooling is enabled. In general, this behavior should not be modified. If changed, the
change should be made at the site level only so that other sites can continue to take advantage of the
socket pooling feature.
Data type Long
Default value 2
Inheritance FALSE
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/W3SVC IIsWebService
Metabase identifier MD_LEVELS_TO_SCAN
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 357 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
DontLog
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether client requests should be written to the log file. By default (FALSE),
requests are written to the file. You can set this value to TRUE to turn logging off.
Access Locations
This property is accessible at the following locations:
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_DISABLE_SOCKET_POOLING
Default value DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value FALSE
Inheritance Inheritable
Active Server Pages Guide Page 358 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
LogType
DownlevelAdminInstance
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates the server instance for remote administration clients.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/MSFTPSVC/N/ROOT IIsFtpVirtualDir
/LM/MSFTPSVC/N/ROOT/FtpVirtualDir IIsFtpVirtualDir
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_DONT_LOG
Default value DWORD_METADATA
User type IIS_MD_UT_FILE
Data type String
Default value 1 (String)
Inheritance Inheritable
Active Server Pages Guide Page 359 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
AdminServer
EnableDefaultDoc
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that the default document (specified by the DefaultDoc property) for a directory
will be loaded when the directory is being browsed. EnableDefaultDoc is one of the settings contained
in the DirBrowseFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/W3SVC IIsWebService
Metabase identifier MD_DOWNLEVEL_ADMIN_INSTANCE
User type IIS_MD_UT_SERVER
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 360 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
See Also
DirBrowseFlags
EnableDirBrowsing
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies that directory browsing is enabled. EnableDirBrowsing is one of the settings
contained in the DirBrowseFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Metabase identifier MD_DIRECTORY_BROWSING
Metabase bitmask identifier MD_DIRBROW_LOADDEFAULT
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x40000000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Active Server Pages Guide Page 361 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
See Also
DirBrowseFlags
EnableDocFooter
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables or disables custom footers specified by the DefaultDocFooter property. Higher
performance will be achieved if custom footers are disabled.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_DIRECTORY_BROWSING
Metabase bitmask identifier MD_DIRBROW_ENABLED
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Metabase bitmask value 0x80000000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 362 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
DefaultDocFooter
EnableReverseDns
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables or disables reverse Domain Name Server (DNS) lookups (reverse lookups
involve finding the domain name from an IP address). Reverse DNS lookups can use significant
resources and time.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_FOOTER_ENABLED
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Active Server Pages Guide Page 363 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ExitMessage
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the message text an FTP server will transmit to a client when the client sends a
quit command.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
FilterDescription
This is preliminary documentation for IIS 5.0 and is subject to change.
This property holds a string, which serves as the description for the corresponding filter.
Metabase identifier MD_DO_REVERSE_DNS
Data type DWORD_METADATA
User type IIS_MD_UT_FILE
Data type String
Default value Empty string
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
Metabase identifier MD_EXIT_MESSAGE
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 364 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
FilterEnabled
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the filter is enabled.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Data type String
Default value Empty
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Filter IIsFilter
/LM/W3SVC/N/Filters/Filter IIsFilter
Metabase identifier MD_FILTER_DESCRIPTION
User type IIS_MD_UT_SERVER
Data type Boolean
Default value FALSE
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Filter IIsFilter
/LM/W3SVC/N/Filters/Filter IIsFilter
Active Server Pages Guide Page 365 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
FilterFlags
This is preliminary documentation for IIS 5.0 and is subject to change.
This property contains flags that indicate which events the ISAPI filter has registered to be notified for.
This property, and all its component flags, should be considered read-only. For more information, see
Developing ISAPI Filters.
FilterFlags contains the following flags:
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_FILTER_ENABLED
User type IIS_MD_UT_SERVER
NotifyAccessDenied NotifyNonSecurePort NotifyReadRawData
NotifyAuthentication NotifyOrderHigh NotifySecurePort
NotifyEndOfNetSession NotifyOrderLow NotifySendRawData
NotifyEndOfRequest NotifyOrderMedium NotifySendResponse
NotifyLog NotifyPreProcHeaders NotifyUrlMap
Data type Long
Default value Not set
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Filter IIsFilter
/LM/W3SVC/N/Filters/Filter IIsFilter
Active Server Pages Guide Page 366 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Bitmask Values
FilterLoadOrder
This is preliminary documentation for IIS 5.0 and is subject to change.
This property, a comma-delimited list, specifies the order in which filters are to be loaded, such as
Metabase identifier MD_FILTER_FLAGS
User type IIS_MD_UT_SERVER
Default bitmask setting (None set)
Constant Value Description
MD_NOTIFY_SECURE_PORT 0x00000001 Notify only if port secure.
MD_NOTIFY_NONSECURE_PORT 0x00000002 Notify only if port nonsecure.
MD_NOTIFY_READ_RAW_DATA 0x00008000 Notify if reading raw data.
MD_NOTIFY_PREPROC_HEADERS 0x00004000 Notify if preprocessing
headers.
MD_NOTIFY_AUTHENTICATION 0x00002000 Notify if performing
authentication.
MD_NOTIFY_URL_MAP 0x00001000 Notify if mapping URL to
physical path.
MD_NOTIFY_ACCESS_DENIED 0x00000800 Notify if server sending HTTP
error 401 to client.
MD_NOTIFY_SEND_RESPONSE 0x00000040 Notify if response being sent to
client.
MD_NOTIFY_SEND_RAW_DATA 0x00000400 Notify if sending raw data.
MD_NOTIFY_LOG 0x00000200 Notify if logging.
MD_NOTIFY_END_OF_REQUEST 0x00000080 Notify if request has ended.
MD_NOTIFY_END_OF_NET_SESSION 0x00000100 Notify if network session is
ending.
MD_NOTIFY_ORDER_HIGH 0x00080000 High priority for notifications.
MD_NOTIFY_ORDER_MEDIUM 0x00040000 Medium priority for
notifications.
MD_NOTIFY_ORDER_LOW,
MD_NOTIFY_ORDER_DEFAULT
0x00020000 Low priority for notifications.
Active Server Pages Guide Page 367 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Filter1, Filter2, and so on.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
FilterPath
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the full path to a filter DLL; for example C:\Wwwroot\Bin\Filter.dll.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
Data type String
Default value Empty string
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Filter IIsFilter
/LM/W3SVC/N/Filters/Filter IIsFilter
Metabase identifier MD_FILTER_LOAD_ORDER
User type IIS_MD_UT_SERVER
Data type String
Default value Empty
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Filter IIsFilter
/LM/W3SVC/N/Filters/Filter IIsFilter
Active Server Pages Guide Page 368 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
FilterState
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the filter is loaded (value 1) or unloaded (value 4). This property is read-
only.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask values
Metabase identifier MD_FILTER_IMAGE_PATH
User type IIS_MD_UT_SERVER
Data type Long
Default value Not set
Possible values 1 or 4
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Filter IIsFilter
/LM/W3SVC/N/Filters/Filter IIsFilter
Metabase identifier MD_FILTER_STATE
User type IIS_MD_UT_SERVER
Constant Value Description
MD_FILTER_STATE_LOADED 0x00000001 Filter loaded.
MD_FILTER_STATE_UNLOADED 0x00000004 Filter unloaded.
Active Server Pages Guide Page 369 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
FrontPageWeb
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether this server instance will be targeted by Microsoft
FrontPage
. Setting
this value to TRUE causes the FrontPage Manager to create the files required for FrontPage Server
Extensions. Setting this value to FALSE causes these files to be deleted.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
FtpDirBrowseShowLongDate
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether or not to display two-digit or four-digit years when browsing directories.
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
Metabase identifier MD_FRONTPAGE_WEB
Default value DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 370 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
GreetingMessage
This is preliminary documentation for IIS 5.0 and is subject to change.
This property contains a greeting message (in a multiple-line string) that can be sent to new clients from
an FTP server.
Access Locations
This property is accessible at the following locations:
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/MSFTPSVC/N/ROOT IIsFtpVirtualDir
/LM/MSFTPSVC/N/ROOT/FtpVirtualDir IIsFtpVirtualDir
Metabase identifier MD_SHOW_4_DIGIT_YEAR
Default value DWORD_METADATA
User type IIS_MD_UT_FILE
Data type List (string)
Default value Empty list
Inheritance Inheritable
Active Server Pages Guide Page 371 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcCacheControlHeader
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the directive that IIS will add to the Cache-Control header. This
header, along with the Expires header specified by HcExpiresHeader, is sent with every compressed
file that is sent to a client browser.
This property specifies a header that overrides the HTTP Expires header specified by
HcExpiresHeader, and is included to ensure that older clients and proxy servers will not attempt to
cache compressed files.
Neither the header specified by HcCacheControlHeader nor the header specified by
HcExpiresHeader will be sent with the response if the metabase property HcSendCacheHeaders is
set to FALSE.
The Web service must be restarted before any changes to this property take effect.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
Metabase identifier MD_GREETING_MESSAGE
Date type MULTISZ_METADATA
User type IIS_MD_UT_SERVER
Data type String
Default value max-age=86400
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Active Server Pages Guide Page 372 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcCompressionBufferSize
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the size of the buffer, in bytes, that IIS will use for receiving
compressed data. This buffer is used for both on-demand compression of static content, as well dynamic
content compression. A larger buffer will yield slightly faster compression performance, but at the cost of
additional memory usage.
The size limit specified by HcCompressionBufferSize is used by IIS only if either
HcDoOnDemandCompression or HcDoDynamicCompression are set to TRUE. The maximum
allowable size of the buffer is 1,048,576 bytes (1 MB).
The Web service must be restarted before any changes to this property take effect.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_DIRECTORY_BROWSING.
Metabase identifier MD_HC_CACHE_CONTROL_HEADER
User type IIS_MD_UT_SERVER
Data type Long
Default value 8192 (bytes)
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_COMPRESSION_BUFFER_SIZE
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 373 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
HcCompressionDirectory
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the directory where compressed versions of static files are temporarily
cached. If compression is enabled for IIS, every time IIS receives a request for a static file (such as
an .htm or .txt file), the server searches the compression directory for an already-compressed version of
the static file being requested.
To force IIS to recompress all outgoing static files, erase all files found in the compression directory
specified by HcCompressionDirectory.
ImportantIt is strongly recommended that the directory specified by HcCompressionDirectory
reside on an NTFS volume, not on a FAT volume. If the file being requested resides on an NTFS
volume, and you have set HcCompressionDirectory to specify a FAT volume, IIS will not perform any
HTTP compression on that file. This behavior is due to a number of differences between FAT and NTFS
volumes, including different time stamping and access control mechanisms. In addition, NTFS handles
directories that contain a large number of files more efficiently than FAT volumes do.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
HcDoOnDemandCompression
Data type String (with replacement)
Default value %windir%\IIS Temporary Compressed Files
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_COMPRESSION_DIRECTORY
Date type EXPANDSZ_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 374 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
HcCompressionDll
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the fully qualified file system path and file name of the compression
DLL associated with the compression scheme.
The Web service must be restarted before any changes to this property take effect.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcCreateFlags
This is preliminary documentation for IIS 5.0 and is subject to change.
This property is reserved for future use.
Access Locations
This property is accessible at the following location:
Data type String (with replacement)
Default value %windir%\system32\inetsrv\SchemeName.dll
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_COMPRESSION_DLL
Date type EXPANDSZ_METADATA
User type IIS_MD_UT_SERVER
Data type Long
Inheritance Not inheritable
Active Server Pages Guide Page 375 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcDoDiskSpaceLimiting
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property allows you to limit the amount of disk space that compressed files (stored in the
compression directory specified by HcCompressionDirectory) can occupy. If this property is set to
TRUE, then IIS will not occupy more than the number of bytes specified by HcMaxDiskSpaceUsage
with compressed files. Once the limit is reached, compressed files are removed from the compression
directory on a least-recently used (LRU) basis. If HcDoDiskSpaceLimiting is set to FALSE, IIS
enforces no limit to the amount of disk space that the files in the compression directory can occupy.
TipLimiting the use of disk space has a significant impact on performance because additional overhead
is required to check for the limit. Use this feature only if it is necessary.
HcDoDiskSpaceLimiting is relevant only if you have set the property
HcDoOnDemandCompression to TRUE.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_CREATE_FLAGS
User type IIS_MD_UT_SERVER
Data type Boolean
Default value FALSE
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Active Server Pages Guide Page 376 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
HcDoDynamicCompression
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether compression of responses to requests for dynamic content, such as the
output of ASP scripts and ISAPI extensions, is enabled. At the global level,
HcDoDynamicCompression indicates that all dynamic content will be compressed as it is requested.
For individual compression schemes, HcDoDynamicCompression specifies whether that particular
compression scheme supports compression of dynamic content.
ImportantBecause dynamic content is by definition changeable, IIS does not cache compressed
versions of dynamic output. Thus, if dynamic compression is enabled, each and every response to
requests for dynamic content will have to be compressed each time. Dynamic compression consumes
considerable CPU time and memory resources, and it should only be used on servers that have slow
networks, but CPU power to spare.
Because HcDoDynamicCompression is not inheritable, HcDoDynamicCompression must be set to
TRUE at both the global level and the individual scheme level in order for dynamic compression to
actually be enabled for a server.
If you change the value of this property at the individual compression scheme level, the Web service will
need to be restarted for the change to take effect.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Metabase identifier MD_HC_DO_DISK_SPACE_LIMITING
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value FALSE
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Active Server Pages Guide Page 377 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.
HcDoOnDemandCompression
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether static files, such as .htm and .txt files, will be compressed if no
compressed version of the file exists in the compression directory specified by
HcCompressionDirectory.
At a global level, if this property is set to TRUE, and IIS receives a request for static content, IIS will
check the compression directory. If no corresponding compressed version of the requested file is found,
IIS will send an uncompressed version of the requested file to the client browser while a background
thread compresses the file. The newly compressed file will then be stored in the compression directory,
and subsequent responses to requests for that file will be serviced directly from the directory. If
HcDoOnDemandCompression is set to FALSE at a global level, however, IIS will not compress
static content files for which it finds no corresponding compressed version in the compression directory.
In other words, an uncompressed version of the file will be returned for every request unless a
compressed version of the file already exists in the compression directory.
At an individual compression scheme level, HcDoOnDemandCompression indicates whether that
particular compression scheme supports on-demand compression.
Because HcDoOnDemandCompression is not inheritable, in order for static on-demand compression
to actually be enabled for a server, HcDoOnDemandCompression must be set to TRUE at both the
global and individual scheme level.
If you change the value of this property at the individual compression scheme level, the Web service will
need to be restarted for the change to take effect.
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_HC_DO_DYNAMIC_COMPRESSION
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value TRUE
Inheritance Not inheritable
Active Server Pages Guide Page 378 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcDoStaticCompression
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether responses to requests for static content will be compressed by
IIS. At the global level, HcDoStaticCompression indicates that IIS will respond to requests for static
content (such as .htm and .txt files) first by checking the compression directory specified by
HcCompressionDirectory. If a compressed version of the static file is found in the directory, it will be
sent to the client browser. Otherwise, if on-demand compression is enabled with
HcDoOnDemandCompression, IIS will send the requested file in uncompressed form, and add that
file to the background compression queue.
At the individual compression scheme level, HcDoStaticCompression indicates whether the individual
compression scheme supports compression of static files.
Because HcDoStaticCompression is not inheritable, in order for static compression to actually be
enabled for a server, HcDoStaticCompression must be set to TRUE at both the global level and
individual scheme level.
If you change the value of this property at the individual compression scheme level, the Web service must
be restarted for the change to take effect.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_DO_ON_DEMAND_COMPRESSION
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value TRUE
Inheritance Not inheritable
Active Server Pages Guide Page 379 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcDynamicCompressionLevel
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the compression level for the compression scheme, when the scheme is
compressing dynamic content. Low compression levels produce slightly larger compressed files, but with
lower overall impact on CPU and memory resources. Higher compression levels generally result in
smaller compressed files but higher CPU and memory usage.
The Web service must be restarted for any changes to this property take effect.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_DO_DYNAMIC_COMPRESSION
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Long
Default value 1 (range 1-10)
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Active Server Pages Guide Page 380 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
HcExpiresHeader
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the content of the HTTP Expires header that is sent with all requested
compressed files, along with the Cache-Control header discussed in HcCacheControlHeader.
The combination of HcExpiresHeader and HcCacheControlHeader ensure that older clients and
proxy servers will not attempt to cache compressed files.
Neither the header specified by HcCacheControlHeader, nor the header specified by
HcExpiresHeader, will be sent with the response if the metabase property HcSendCacheHeaders is
set to FALSE.
The Web service must be restarted for any changes to this property take effect.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_HC_DYNAMIC_COMPRESSION_LEVEL
User type IIS_MD_UT_SERVER
Data type String
Default value Wed, 01 Jan 1997 12:00:00 GMT
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_EXPIRES_HEADER
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 381 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
HcFileExtensions
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates which file name extensions are supported by the compression scheme. Only static
files with the specified file extensions will be compressed by IIS. If this setting is empty, then the scheme
supports all file name extensions.
In addition to file name extension matches, HcDoOnDemandCompression and
HcDoStaticCompression must be set to TRUE for compression to be performed.
The Web service must be restarted for any changes to this property take effect.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
HcScriptFileExtensions
HcFilesDeletedPerDiskFree
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the number of compressed files that are deleted from the compression
directory when IIS determines that the compression directory has grown beyond its limits. IIS will delete
a number of files equal to the setting of this property, starting with the least-recently used files.
Data type List (string)
Default value htm, html, txt
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_FILE_EXTENSIONS
Date type MULTISZ_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 382 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The HcFilesDeletedPerDiskFree property is relevant only if HcDoDiskSpaceLimiting is set to
TRUE, and HcMaxDiskSpaceUsage is set to something other than 0xFFFFFFFF (unlimited). The
maximum allowable value of HcFilesDeletedPerDiskFree is 1024.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcIoBufferSize
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the size of the buffer, in bytes, that IIS will use to read uncompressed
files. A larger buffer will yield slightly faster compression performance, but at the cost of additional
memory usage.
HcIoBufferSize is used by IIS only if HcDoOnDemandCompression is set to TRUE. The maximum
allowable value is 1,048,576 bytes (1 MB).
The Web service must be restarted before any changes to this property take effect.
Access Locations
This property is accessible at the following locations:
Data type Long
Default value 256
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_FILES_DELETED_PER_DISK_FREE
User type IIS_MD_UT_SERVER
Data type Long
Default value 8192 bytes
Inheritance Not inheritable
Active Server Pages Guide Page 383 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcMaxDiskSpaceUsage
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether IIS will limit the number of bytes of disk space occupied by
compressed file in the compression directory.
Disk space limiting is performed, and HcMaxDiskSpaceUsage is checked by IIS, only if
HcDoDiskSpaceLimiting is set to TRUE. If HcMaxDiskSpaceUsage is set to 0xFFFFFFFF, there
will be no limit on the number of bytes occupied by compressed files.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_IO_BUFFER_SIZE
User type IIS_MD_UT_SERVER
Data type Long
Default value 1,000,000 bytes
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_MAX_DISK_SPACE_USAGE
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 384 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
HcMaxQueueLength
This is preliminary documentation for IIS 5.0 and is subject to change.
IIS performs on-demand compression of static content in the background. When a static file is
requested, and IIS has determined that a previously compressed version of the requested file does not
already exist in the compression directory, the request is put into a simple FIFO (first in, first out) queue.
HcMaxQueueLength specifies how many concurrent background compression requests can be in the
queue. If the queue is full, additional compression requests are ignored until there is room in the queue.
If HcMaxQueueLength is set to 0xFFFFFFFF, there is no limit to the number of pending requests in
the queue.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcMimeType
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates which MIME types are supported by the compression scheme. Only static files
with the specified MIME type will be compressed by IIS. If this setting is empty, then the scheme
supports all MIME types.
In addition to MIME type matches, HcDoOnDemandCompression and HcDoStaticCompression
must be set to TRUE for compression to be performed.
The Web service must be restarted before any changes to this property take effect.
Data type Long
Default value 1000
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_MAX_QUEUE_LENGTH
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 385 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcMinFileSizeForComp
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to specify the minimum number of bytes a file must contain for it to be
compressed using on-demand compression. Very small files do not compress well, and in some cases
compression may even make the file larger than it was initially.
If HcMinFileSizeForComp is set to 0 (zero), all files will be compressed.
Access Locations
This property is accessible at the following location:
Data type String
Default value text/html text/text
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_MIME_TYPE
Data type STRING_METADATA
User type IIS_MD_UT_SERVER
Data type Long
Default value 256 bytes
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Active Server Pages Guide Page 386 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcNoCompressionForHttp10
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property disables compression for requests containing an HTTP 1.0 version number.
HTTP 1.0, as described in RFC 1945, provides a minimal level of support for certain types of
compression. However, some confusion exists around HTTP 1.0 compression, especially with regard to
proxy servers. In order to minimize the chance of inappropriately returning a compressed file to a client
that cannot decompress the file, you can use this metabase property to disable compression in
questionable scenarios.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcNoCompressionForProxies
Metabase identifier MD_HC_MIN_FILE_SIZE_FOR_COMP
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value TRUE
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_NO_COMPRESSION_FOR_HTTP_10
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 387 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property allows you to disable the HTTP 1.1 response for compression requests that
have come through proxy servers. Certain HTTP proxy servers, including some advertised as HTTP
1.1-compliant, do not handle the caching of compressed objects correctly.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcNoCompressionForRange
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies how IIS handles HTTP Range requests. The HTTP 1.1 RFC, RFC
2068, is ambiguous about whether Range requests should apply to the compressed or uncompressed
version of a file. It is possible that some browsers could be unprepared for compressed Range
responses, so IIS defaults to not sending compressed responses to Range requests, to avoid problems
with browser misbehavior.
Access Locations
Data type Boolean
Default value FALSE
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_NO_COMPRESSION_FOR_PROXIES
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value FALSE
Inheritance Not inheritable
Active Server Pages Guide Page 388 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcOnDemandCompLevel
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the compression level for the compression scheme, when the scheme is
to compress static content on demand. Low compression levels produce slightly larger compressed files,
but with lower overall impact on CPU and memory resources. Higher compression levels generally result
in small compressed files but higher CPU and memory usage.
Valid compression levels are from 1 to 10.
The Web service must be restarted before any changes to this property take effect.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_NO_COMPRESSION_FOR_RANGE
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Long
Default value 10
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Active Server Pages Guide Page 389 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
HcDynamicCompressionLevel
HcPriority
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies the priority rating assigned to a particular compression scheme. If your
installation of IIS has multiple compression schemes installed, and a client browser indicates (in the
Accept-Encoding header) that it can handle multiple compression schemes, IIS uses the priority numbers
specified in HcPriority to determine which scheme to use for the request. In that case, IIS will use the
matching scheme that has the highest priority number.
Valid priority numbers can be from 1 to 10. In general, if you have multiple compression schemes
installed with IIS, you should assign each compression scheme a different priority number.
The Web service must be restarted before any changes to this property take effect.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
Metabase identifier MD_HC_ON_DEMAND_COMP_LEVEL
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data type Long
Default value 5
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_PRIORITY
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 390 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
HcSendCacheHeaders
This is preliminary documentation for IIS 5.0 and is subject to change.
This metabase property specifies whether the headers specified by HcCacheControlHeader and
HcExpiresHeader are sent with each compressed response. If this property is set to TRUE, Cache-
Control and Expires headers are sent with all compressed responses. If this property is set to FALSE,
however, only the HTTP 1.1 Vary header will be sent with the compressed response.
ImportantIn general, the Cache-Control and Expires HTTP headers are included with compressed
responses to prevent inappropriate caching of compressed files, especially by proxy servers and older
browsers. If you choose to disable these headers, it is recommended that you also set
HcNoCompressionForProxies and HcNoCompressionForHttp10 to TRUE.
Access Locations
This property is accessible at the following location:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HcScriptFileExtensions
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates which file name extensions are supported by the compression scheme. Only
dynamic files with the specified file extensions will be compressed by IIS. If this setting is empty, then the
scheme supports all file name extensions.
Also, HcDoOnDemandCompression and HcDoStaticCompression must be set to TRUE for
compression to be performed.
Data type Boolean
Default value TRUE
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
Metabase identifier MD_HC_SEND_CACHE_HEADERS
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 391 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The Web service must be restarted for any changes to this property take effect.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
HcFileExtensions
HttpCustomHeaders
This is preliminary documentation for IIS 5.0 and is subject to change.
This property contains custom headers that are sent to the client in addition to the default header of the
HTML file. Each string in this property is formatted as a key name and value pair: Keyname, Value.
Access Locations
This property is accessible at the following locations:
Data type List (string)
Default value dll, asp, exe
Inheritance Not inheritable
Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme
Metabase identifier MD_HC_SCRIPT_FILE_EXTENSIONS
Date type MULTISZ_METADATA
User type IIS_MD_UT_SERVER
Data type List (string)
Default value Empty list
Inheritance Inheritable
Active Server Pages Guide Page 392 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HttpErrors
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the custom error string to be sent to clients in response to HTTP 1.1 errors. Each
string in the list specifies the HTTP error code and subcode, indicates whether the handler will be a URL
or a file, and specifies which URL or file the client will be sent. Each string can be in either format. To
send a URL to the client, use HTTPErrorCode, HTTPErrorSubcode, URL, HandlerURL. To send a
file, use HTTPErrorCode, HTTPErrorSubcode, FILE, Filename.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_HTTP_CUSTOM
Date type MULTISZ_METADATA
User type IIS_MD_UT_FILE
Data type List (string)
Default value Empty list
Inheritance Inheritable
Active Server Pages Guide Page 393 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
CustomErrorDescriptions
HttpExpires
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the expiration of HTML document content by returning the value to the browser
in the HTML file header. The browser compares the value of this property with the current date to
determine whether to display a cached page or to request an updated page from the server. This
property can be made relative, or dynamic, by using the format D,#SecondsUntilExpiration (with
0xFFFFFFFF indicating no expiration date). It can also be absolute, with the format
S,ValidGMTString.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_HTTP_CUSTOM
Date type MULTISZ_METADATA
User type IIS_MD_UT_FILE
Data type String
Default value D,0xFFFFFFFF (No expiration)
Inheritance Inheritable
Active Server Pages Guide Page 394 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HttpPics
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the World Wide Web Consortium (W3C) Platform for Internet Content
Selection (PICS) rating header. For more information on PICS, see the W3C Web site.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_HTTP_EXPIRES
Date type MULTISZ_METADATA
User type IIS_MD_UT_FILE
Data type List (string)
Default value Empty list
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
Active Server Pages Guide Page 395 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
HttpRedirect
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the directory or URL to which a client is redirected when the client attempts to
access a specific resource. There are two general forms that the value for this property can take.
The simple format is Destination, Flag, where Destination can specify either a URL or a virtual path to
a file. Flag can have one of three values: EXACT_DESTINATION indicates that the value provided for
Destination should be considered an absolute target location; CHILD_ONLY indicates that the value
should be added to the beginning of the file name of the request to be redirected; and PERMANENT
indicates that this redirection will be permanent for this resource.
The more complex form of specification for this property involves the use of wildcards. The format is *;
Wildcard1; Destination1; Wildcard2; Destination2, Flag. Each Wildcard; Destination pair indicates
that requests matching the wildcard are redirected to the specified destination. Flag can have the same
values as the simple string format.
Access Locations
This property is accessible at the following locations:
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_HTTP_PICS
Date type MULTISZ_METADATA
User type IIS_MD_UT_FILE
Data type String
Default value Empty string (no redirects)
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
/LM/W3SVC/N/ROOT IIsWebVirtualDir
Active Server Pages Guide Page 396 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
InProcessIsapiApps
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies a list of ISAPI filters and extensions that must be run in the Web server process.
The string format is either Fullpath\Appname.dll, or just Appname.dll. ISAPI DLL entries without a
qualifying path will match any ISAPI request that contains the DLL name, regardless of the physical path
specified in the request.
For example, any of the following would be a valid list for the property: "D:\winnt\system32
\inetsrv\ssinc.dll" "D:\winnt\system32\inetsrv\httpodbc.dll" "author.dll" "shtml.dll" "admin.dll."
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_HTTP_REDIRECT
Date type MULTISZ_METADATA
User type IIS_MD_UT_FILE
Data type List (string)
Default value httpodbc.dll
ssinc.dll
Inheritance Inheritable
Metabase Path Key Type
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 397 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.
Remarks
This property indicates only which ISAPI applications are required to run in-process. The inclusion of an
application in this list does not imply that the application is automatically run at server startup. Note that
there can be significant performance issues if too many applications are forced to run outside of the
server process.
See Also
AppIsolated
IPSecurity
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the IP access restrictions for a URL. It can be used to grant or deny access to
browsers based on either their IP address or DNS host name.
NoteFor a more detailed explanation for this object, see IIsIPSecurity.
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_IN_PROCESS_ASAPI_APPS
Date type MULTISZ_METADATA
User type IIS_MD_UT_SERVER
Data type Binary reference
Default value No IP restrictions
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/MSFTPSVC/N/ROOT IIsFtpVirtualDir
/LM/MSFTPSVC/N/ROOT/FtpVirtualDir IIsFtpVirtualDir
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 398 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
See Also
IIsIPSecurity
KeyType
This is preliminary documentation for IIS 5.0 and is subject to change.
The KeyType property specifies the type of a metabase key, and the IIS Admin Object that relates to
that key. The KeyType property is used to specify the class of the object associated with the key, such
as IIsWebServer or IIsWebVirtualDir. The KeyType determines the set of properties accessible at
the key.
Remarks
The KeyType property is accessible by all IIS Admin Objects. The value is the name of the IIS Admin
Object accessed, and is the same as the ADSI Class property.
LogAnonymous
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies whether anonymous requests are logged to the event log.
/LM/W3SVC/N/ROOT IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir IIsWebVirtualDir
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory IIsWebDirectory
/LM/W3SVC/N/ROOT/WebVirtualDir/WebDirectory/WebFile IIsWebFile
Metabase identifier MD_IP_SEC
User type IIS_MD_UT_FILE
Data type String
Default value Empty string
Inheritance Not inheritable
Active Server Pages Guide Page 399 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
LogCustomPropertyDataType
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates the data type of a custom logging field to which this property applies. The
constants used to specify the data type are listed in the following table:
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
Metabase identifier MD_LOG_ANONYMOUS
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Data Type Value
Int 0
Unsigned int 1
Long 2
Unsigned long 3
Float 4
Double 5
Lpstr 6
Lpwstr 7
Active Server Pages Guide Page 400 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
For more information about custom logging fields, see Setting Metabase Properties for Logging.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
Data type Long
Default value 0 (int)
Inheritance Inheritable
Metabase Path Key Type
/LM/Logging/CustomLogging IIsCustomLogModule
/LM/Logging/CustomLogging/Field IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup/Field IIsCustomLogModule
Metabase identifier MD_LOGCUSTOM_PROPERTY_DATATYPE
User type IIS_MD_UT_SERVER
Constant Value Description
MD_LOGCUSTOM_DATATYPE_INT 0x00000000 Datatype is int.
MD_LOGCUSTOM_DATATYPE_UINT 0x00000001 Datatype is unsigned int.
MD_LOGCUSTOM_DATATYPE_LONG 0X00000002 Datatype is long.
MD_LOGCUSTOM_DATATYPE_ULONG 0X00000003 Datatype is unsigned long.
MD_LOGCUSTOM_DATATYPE_FLOAT 0X00000004 Datatype is float.
MD_LOGCUSTOM_DATATYPE_DOUBLE 0X00000005 Datatype is double.
MD_LOGCUSTOM_DATATYPE_LPSTR 0X00000006 Datatype is long pointer to
string array.
MD_LOGCUSTOM_DATATYPE_LPWSTR 0X00000007 Datatype is lpwstr.
Active Server Pages Guide Page 401 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
LogCustomPropertyHeader
This is preliminary documentation for IIS 5.0 and is subject to change.
The LogCustomPropertyHeader property indicates which header string will be written to the log file
for the custom logging field to which this property applies.
For more information about custom logging fields, see Setting Metabase Properties for Logging.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
LogCustomPropertyID
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the identifier of the metabase property that will be used to determine if logging is
enabled or disabled for the specific logging field in question. To get the identifier for a given property, you
must first determine what the underlying metabase identifier constant is for the administration property in
question. You can then refer to the header file iiscnfg.h to determine the identifier for that constant.
For instance, the ADSI administration property named LogExtFileFlags refers to the underlying
Data type String
Default value Empty string
Inheritance Inheritable
Metabase Path Key Type
/LM/Logging/CustomLogging IIsCustomLogModule
/LM/Logging/CustomLogging/Field IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup/Field IIsCustomLogModule
Metabase identifier MD_LOGCUSTOM_PROPERTY_HEADER
Date type DWORD_METADATA
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 402 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
property identified by MD_LOGEXT_FIELD_MASK, the value of which is 4013.
When a logging module is called to log custom information fields, the logging module will access the
property specified by LogCustomPropertyID, and check the individual flag bits, specified by
LogCustomPropertyMask, to determine if that particular field is currently enabled or disabled.
For more information about custom logging fields, see Setting Metabase Properties for Logging.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
LogCustomPropertyMask
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the bitmask that can be used against the metabase property, specified by
LogCustomPropertyID, to determine whether the particular logging field is currently enabled or
disabled.
When a logging module is asked to log custom information fields, the logging module will access the
property specified by LogCustomPropertyID, and check the individual flag bits, specified by
LogCustomPropertyMask, to determine if that particular field is currently enabled or disabled.
For more information about custom logging fields, see Setting Metabase Properties for Logging.
Data type Long
Default value 0
Inheritance Inheritable
Metabase Path Key Type
/LM/Logging/CustomLogging IIsCustomLogModule
/LM/Logging/CustomLogging/Field IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup/Field IIsCustomLogModule
Metabase identifier MD_LOGCUSTOM_PROPERTY_ID
User type IIS_MD_UT_SERVER
Active Server Pages Guide Page 403 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
LogCustomPropertyName
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies the name of the custom logging information field. This name generally should be
the name used in the user interface for the logging module.
For more information about custom logging fields, see Setting Metabase Properties for Logging.
Access Locations
This property is accessible at the following locations:
Data type Long
Default value 0
Inheritance Inheritable
Metabase Path Key Type
/LM/Logging/CustomLogging IIsCustomLogModule
/LM/Logging/CustomLogging/Field IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup/Field IIsCustomLogModule
Metabase identifier MD_LOGCUSTOM_PROPERTY_MASK
User type IIS_MD_UT_SERVER
Data type String
Default value Empty string
Inheritance Inheritable
Active Server Pages Guide Page 404 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
LogCustomPropertyServicesString
This is preliminary documentation for IIS 5.0 and is subject to change.
This property specifies to which services the custom logging fields will apply.
For more information about custom logging fields, see Setting Metabase Properties for Logging.
Access Locations
This property is accessible at the following locations:
Metabase Path Key Type
/LM/Logging/CustomLogging IIsCustomLogModule
/LM/Logging/CustomLogging/Field IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup/Field IIsCustomLogModule
Metabase identifier MD_LOGCUSTOM_PROPERTY_NAME
User type IIS_MD_UT_SERVER
Data type List
Default value W3SVC
MSFTPSVC
SMTPSVC
NNTPSVC
Inheritance Inheritable
Metabase Path Key Type
/LM/Logging/CustomLogging IIsCustomLogModule
/LM/Logging/CustomLogging/Field IIsCustomLogModule
/LM/Logging/CustomLogging/FieldGroup IIsCustomLogModule
Active Server Pages Guide Page 405 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
LogExtFileBytesRecv
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the total number of bytes received is written to the log file during logging
events. This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
/LM/Logging/CustomLogging/FieldGroup/Field IIsCustomLogModule
Metabase identifier MD_LOGCUSTOM_SERVICES_STRING
Date type MULTISZ_METADATA
User type IIS_MD_UT_SERVER
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 406 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileBytesSent
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the total number of bytes sent is written to the log file during logging
events. This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_BYTES_RECV
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00002000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 407 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileClientIp
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the client's IP address is written to the log file during logging events. This
property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_BYTES_SENT
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00001000
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 408 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileComputerName
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables the name of the local machine to be logged during logging events. This property is
one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_CLIENT_IP
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000004
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 409 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileCookie
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether information from the client cookie is written to the log file during logging
events. This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_COMPUTER_NAME
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000020
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 410 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileDate
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the date is included in the information written to the log file during a
logging event. This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_COOKIE
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00020000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 411 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileFlags
This is preliminary documentation for IIS 5.0 and is subject to change.
This property contains flags that indicate to Windows 2000 Server which categories of information are
written to the log file (or ODBC data source) during logging events. The following individual flags are
included in this property:
Access Locations
This property is accessible at the following locations:
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_DATE
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000001
LogExtFileBytesRecv LogExtFileMethod LogExtFileTimeTaken
LogExtFileBytesSent LogExtFileProtocolVersion LogExtFileUriQuery
LogExtFileClientIp LogExtFileReferer LogExtFileUriStem
LogExtFileComputerName LogExtFileServerIp LogExtFileUserAgent
LogExtFileCookie LogExtFileServerPort LogExtFileUserName
LogExtFileDate LogExtFileSiteName LogExtFileWin32Status
LogExtFileHttpStatus LogExtFileTime
Data type Long
Default value LogExtFileClientIp, LogExtFileHttpStatus,
LogExtFileMethod, LogExtFileTime,
LogExtFileUriStem (all set to TRUE)
Inheritance Inheritable
Active Server Pages Guide Page 412 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
IIS Admin Base Object Information
The following tables list additional information required only for code that uses the IIS Admin Base
Object.
Bitmask Values
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Metabase identifier MD_LOGEXT_FIELD_MASK
User type IIS_MD_UT_FILE
Default bitmask setting MD_EXTLOG_CLIENT_IP
MD_EXTLOG_TIME
MD_EXTLOG_METHOD
MD_EXTLOG_URI_STEM
MD_EXTLOG_HTTP_STATUS
Default bitmask value 0x 00000586
Constant Value Description
MD_EXTLOG_DATE 0x00000001 Log date.
MD_EXTLOG_TIME 0x00000002 Log time.
MD_EXTLOG_CLIENT_IP 0x00000004 Log client IP address.
MD_EXTLOG_USERNAME 0x00000008 Log user name.
MD_EXTLOG_SITE_NAME 0x00000010 Log site name.
MD_EXTLOG_COMPUTER_NAME 0x00000020 Log computer name.
MD_EXTLOG_SERVER_IP 0x00000040 Log server's own IP address.
MD_EXTLOG_METHOD 0x00000080 Log protocol method.
MD_EXTLOG_URI_STEM 0x00000100 Log URI stem.
MD_EXTLOG_URI_QUERY 0x00000200 Log URI query.
Active Server Pages Guide Page 413 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
LogExtFileHttpStatus
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether HTTP status information is written to the log file during a logging event.
This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
MD_EXTLOG_HTTP_STATUS 0x00000400 Log HTTP status.
MD_EXTLOG_WIN32_STATUS 0x00000800 Log WIN32 status.
MD_EXTLOG_BYTES_SENT 0x00001000 Log total bytes sent.
MD_EXTLOG_BYTES_RECV 0x00002000 Log total bytes received.
MD_EXTLOG_TIME_TAKEN 0x00004000 Log total time elapsed.
MD_EXTLOG_SERVER_PORT 0x00008000 Log server port.
MD_EXTLOG_USER_AGENT 0x00010000 Log user agent.
MD_EXTLOG_COOKIE 0x00020000 Log cookie.
MD_EXTLOG_REFERER 0x00040000 Log referrer.
MD_EXTLOG_PROTOCOL_VERSION 0x00080000 Log client server protocol
version.
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 414 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
See Also
LogExtFileFlags
LogExtFileMethod
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the logging method is written to the log file during a logging event. This
property is one of the flags contained in LogExtFileFlags.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_HTTP_STATUS
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000400
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 415 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileProtocolVersion
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the client/server protocol version is written to the log file during a logging
event. This property is one of the flags contained in LogExtFileFlags.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_METHOD
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000080
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 416 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileReferer
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the referrer field, sent by the client, is written to the log file during a
logging event. This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_PROTOCOL_VERSION
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00080000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 417 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileServerIp
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the server's IP address is written to the log file during a logging event.
This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_REFERER
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00040000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 418 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileServerPort
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the active server port is written to the log file during a logging event. This
property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_SERVER_IP
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000040
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 419 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileSiteName
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the site name is written to the log file during a logging event. This
property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_SERVER_PORT
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00008000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 420 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileTime
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the time is written to the log file during a logging event. This property is
one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_SITE_NAME
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000010
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 421 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileTimeTaken
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables writing into the log file, during logging events, the total time taken for a request to
be completed. This property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_TIME
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000002
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 422 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileUriQuery
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the Universal Resource Identifier (URI) query information is written to
the log file during logging events. The URI query usually consists of parameters passed to the URL by
using the URL?Parameters format. This property is one of the flags contained in the LogExtFileFlags
property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_TIME_TAKEN
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00004000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 423 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileUriStem
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the Universal Resource Identifier (URI) stem information is written to the
log file during logging events. The URI stem usually consists of the actual resource being requested. This
property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_URI_QUERY
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000200
Data type Boolean
Default value TRUE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 424 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileUserAgent
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the contents of the user agent field, sent by the client, are written to the
log file during a logging event. This property is one of the flags contained in the LogExtFileFlags
property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_URI_STEM
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00000100
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 425 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileUserName
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the user's name is written to the log file during logging events. This
property is one of the flags contained in the LogExtFileFlags property.
Access Locations
This property is accessible at the following locations:
IIS Admin Base Object Information
The following table lists additional information required only for code that uses the IIS Admin Base
Object.
NoteThis property is a bitmask flag of the identifier MD_LOGEXT_FIELD_MASK.
Metabase identifier MD_LOGEXT_FIELD_MASK
Metabase bitmask identifier MD_EXTLOG_USER_AGENT
Data type DWORD_METADATA
User type IIS_MD_UT_SERVER
Metabase bitmask value 0x00010000
Data type Boolean
Default value FALSE
Inheritance Inheritable
Metabase Path Key Type
/LM/MSFTPSVC IIsFtpService
/LM/MSFTPSVC/N IIsFtpServer
/LM/W3SVC IIsWebService
/LM/W3SVC/N IIsWebServer
Active Server Pages Guide Page 426 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
LogExtFileFlags
LogExtFileWin32Status
This is preliminary documentation for IIS 5.0 and is subject to change.
This property indicates whether the current Microsoft
Win32
JScript
Scripting Edition
(VBScript) have dissimilar data type implementations when compared to languages such as C and C++.
Use the following table as a reference for ADSI data types, to find the corresponding data type for the
IIS Admin Base Object.
Visual Basic Object Model
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages (ASP) implements classes that enable your component to access the properties and
methods of the ASP built-in objects. The ObjectContext object exposes methods that return an
interface to one of the ASP built-in objects. Your component can use these interfaces to access the
methods and properties of the built-in objects.
The following table lists the built-in object classes:
ADSI Data Type Base Object Data Type
Long, Boolean, Integer DWORD_METADATA
String STRING_METADATA
ExpandSz EXPANDSZ_METADATA
IPSec, NTACL BINARY_METADATA
List MULTISZ_METADATA
MimeMapList MULTISZ_METADATA
Class Use to
Application Calls the methods and properties of the Application object.
ASP Error Object Calls the methods and properties of the ASP Error object.
ObjectContext Returns the built-in objects and provide methods used in
transaction processing.
Request Calls the methods and properties of the Request object.
Response Calls the methods and properties of the Response object.
Active Server Pages Guide Page 492 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
To use the ObjectContext and built-in objects in a Visual Basic component, you must include a
reference to the Microsoft
Collections
Methods
ScriptingContext Returns the built-in objects: Application, Request,
Response, Server, or Session. This is an obsolete
approach. You should use ObjectContext instead.
Server Calls the methods and properties of the Server object.
Session Calls the methods and properties of the Session object.
Contents Contains all of the items that have been added to the
application through script commands.
StaticObjects Contains all of the objects added to the session with
the <OBJECT> tag.
Contents.Remove The Contents.Remove method deletes an item from the Application
object's Contents collection.
Contents.RemoveAll The Contents.RemoveAll method deletes all items from the Application
object's Contents collection.
Lock The Lock method prevents other clients from modifying Application object
properties.
Unlock The Unlock method allows other clients to modify Application object
properties.
Active Server Pages Guide Page 493 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Events
Scripts for the preceding events are declared in the Global.asa file. For more information about these
events and the Global.asa file, see the Global.asa Reference.
Remarks
You can store values in the Application Collections. Information stored in the Application collections is
available throughout the application and has application scope. The following script demonstrates storage
of two types of variables.
<%
Application("greeting") = "Welcome to My Web World!"
Application("num") = 25
%>
Each of these variables would be members of the Application Contents Collection.
You can also assign a component instance to a variable that has application scope. If you assign a
component instance to a variable with the Server.CreateObject method, the variable will be a member
of the Application.Contents collection. If the variable is assigned with the <OBJECT> tag, the variable
will be a member of the Application StaticObjects Collection.
You should be careful about assigning component instances to variables with application scope, because
some components are not designed to be given application scope. For more information, see the
Platform SDK.
If you assign a component instance to a variable in the Application Contents Collection, and use Visual
Basic
Scripting Edition (VBScript) as your primary scripting language, you must use the Set keyword.
This is illustrated in the following script.
<% Set Application("Obj1") = Server.CreateObject("MyComponent") %>
You can then reference the methods and properties of MyComponent on subsequent Web pages by
using this script
<% Application("Obj1").MyObjMethod %>
or by extracting a local copy of the object and using the following
<%
Set MyLocalObj1 = Application("Obj1")
MyLocalObj1.MyObjMethod
%>
Application_OnEnd
Application_OnStart
Active Server Pages Guide Page 494 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Another way to create objects with application scope is by using the <OBJECT> tag in the Global.asa
file. For more information, see the Global.asa Reference.
You cannot store a built-in object in the Application object. For example, each of the following lines
returns an error.
<%
Set Application("var1") = Session
Set Application("var2") = Request
Set Application("var3") = Response
Set Application("var4") = Server
Set Application("var5") = Application
Set Application("var6") = ObjectContext
%>
You should be aware of the threading model used by any components you give application scope. The
threading model used to develop the component will have a significant impact on whether a component
instance should be assigned to a variable in one of the Application collections. For more information,
see Component Design Guidelines.
If you store an array in an Application object, you should not attempt to alter the elements of the stored
array directly. For example, the following script does not work:
<% Application("StoredArray")(3) = "new value" %>
This is because the Application object is implemented as a collection. The array element StoredArray
(3) does not receive the new value. Instead, the value would be included in the Application object
collection, and would overwrite any information that had previously been stored at that location.
It is strongly recommended that if you store an array in the Application object, you retrieve a copy of
the array before retrieving or changing any of the elements of the array. When you are done with the
array, you should store the array in the Application object again, so that any changes you made are
saved. This is demonstrated in the following scripts.
---file1.asp---
<%
'Creating and initializing the array.
dim MyArray()
Redim MyArray(5)
MyArray(0) = "hello"
MyArray(1) = "some other string"
'Storing the array in the Application object.
Application.Lock
Application("StoredArray") = MyArray
Application.Unlock
Server.Transfer("file2.asp")
%>
---file2.asp---
<%
'Retrieving the array from the Application Object
Active Server Pages Guide Page 495 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
'and modifying its second element.
LocalArray = Application("StoredArray")
LocalArray(1) = " there"
'Printing out the string "hello there."
Response.Write(LocalArray(0)&LocalArray(1))
'Re-storing the array in the Application object.
'This overwrites the values in StoredArray with the new values.
Application.Lock
Application("StoredArray") = LocalArray
Application.Unlock
%>
Example
The following example uses the application variable NumVisits to store the number of times that a
particular page has been accessed. The Lock method is called to ensure that only the current client can
access or alter NumVisits. Calling the Unlock method then enables other users to access the
Application object.
<%
Application.Lock
Application("NumVisits") = Application("NumVisits") + 1
Application.Unlock
%>
This application page has been visited
<%= Application("NumVisits") %> times!
You can see a working sample .asp file that uses the Application object in the Building ASP
Applications section of the ASP Samples.
Application Collections
This is preliminary documentation for IIS 5.0 and is subject to change.
The Application object supports these collections:
? Contents
? StaticObjects
Application Contents Collection
This is preliminary documentation for IIS 5.0 and is subject to change.
The Contents collection contains all the items that have been added to the application through a script
command. You can use the Contents collection to obtain a list of items that have been given application
scope, or to specify a particular item to be the target of an operation. You can also remove items from
Active Server Pages Guide Page 496 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
the collection with the Remove and RemoveAll methods.
Syntax
Application.Contents(Key)
Parameters
Key
Specifies the name of the item to retrieve.
Methods
Remarks
The Application.Contents collection contains those items that have been declared at the application
level without using the <OBJECT> tags. This would include both objects created with
Server.CreateObject as well as scalar variables established through an Application declaration. In the
following script, for example, both strHello and objCustom would be members of the
Application.Contents collection:
<%
Application("strHello") = "Hello"
Set Application("objCustom") = Server.CreateObject("MyComponent") %>
The Application.Contents collection supports For...Each and For...Next iteration. The following
script illustrates each of these methods of iterating through the Application.Contents collection:
<%
Application("strText1") = "1234567890"
Application("strText2") = "ABCDEFGHIJ"
Application("strText3") = "A1B2C3D4E5"
%>
<%
For Each Key in Application.Contents
Response.Write Key + " = " + Application(Key) + "<BR>"
Next
%>
<%
For intItem = 1 to Application.Contents.Count
Response.Write CStr(intItem) + " = "
Response.Write Application.Contents(intItem) + "<BR>"
Next
%>
You can see a working sample .asp file that uses the Application.Contents collection in the Building
ASP Applications section of the ASP Samples.
Contents.Remove Deletes an item from the collection.
Contents.RemoveAll Deletes all items from the collection.
Active Server Pages Guide Page 497 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Application StaticObjects Collection
This is preliminary documentation for IIS 5.0 and is subject to change.
The StaticObjects collection contains all of the objects created with the <OBJECT> tags within the
scope of the Application object. You can use the collection to determine the value of a specific property
for an object, or iterate through the collection and retrieve all properties for all static objects.
Syntax
Application.StaticObjects(Key)
Parameters
Key
Specifies the name of the item to retrieve.
Remarks
You can use an iterating control structure to loop through the keys of the StaticObjects collection. This
is demonstrated in the following example.
<%
Dim strKey
For Each strKey In Application.StaticObjects
Response.Write strKey & " = <i>(object)</i><BR>"
Next
%>
Application Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The Application object exposes the following methods:
? Contents.Remove
? Contents.RemoveAll
? Lock
? Unlock
Contents.Remove
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 498 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The Application.Contents.Remove method deletes an item from a collection.
Syntax
Application.Contents.Remove(name|index)
Parameters
name
The identifier for the item to remove.
index
An index offset indicating which item in the list to remove.
Remarks
The Contents.Remove method takes either a string or an integer as an input parameter. If the input
parameter is a string, the method will search the contents collection for an item with that name and
remove it. If the input parameter is an integer, the method counts that number of items from the start of
the collection, and removes the corresponding item.
Example
The following example adds two items to the Application.Contents collection and removes the second
one.
<%
Application("strFirst")=("First thing")
Application("strSecond")=("Second thing")
Application.Contents.Remove(strFirst)
%>
See Also
Contents.RemoveAll
Contents.RemoveAll
This is preliminary documentation for IIS 5.0 and is subject to change.
The Application.Contents.RemoveAll method removes all items that have been added to the
Application.Contents collection.
Syntax
Application.Contents.RemoveAll ()
See Also
Contents.Remove
Active Server Pages Guide Page 499 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Lock
This is preliminary documentation for IIS 5.0 and is subject to change.
The Lock method blocks other clients from modifying the variables stored in the Application object,
ensuring that only one client at a time can alter or access the Application variables. If you do not call the
Unlock method explicitly, the server unlocks the locked Application object when the .asp file ends or
times out.
Syntax
Application.Lock
Example
<%
Application.Lock
Application("NumVisits") = Application("NumVisits") + 1
Application("datLastVisited") = Now()
Application.Unlock
%>
This application page has been visited
<%= Application("NumVisits") %> times!
In the preceding example the Lock method prevents more than one client from accessing the variable
NumVisits at a time. If the application had not been locked, two clients could try to increment the
variable NumVisits simultaneously.
Applies To
Application Object
See Also
Unlock
Unlock
This is preliminary documentation for IIS 5.0 and is subject to change.
The Unlock method enables other clients to modify the variables stored in the Application object after it
has been locked using the Lock method. If you do not call this method explicitly, the Web server
unlocks the Application object when the .asp file ends or times out.
Syntax
Application.Unlock
Active Server Pages Guide Page 500 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Example
<%
Application.Lock
Application("NumVisits") = Application("NumVisits") + 1
Application("datLastVisited") = Now()
Application.Unlock
%>
This application page has been visited
<%= Application("NumVisits") %> times!
In the preceding example the Unlock method releases the locked object so that the next client can
increment NumVisits.
NoteThe application Lock method is cumulative, meaning if the same script calls Lock several times, it
must also call Unlock the same number of times to fully release the application. If this does not occur, the
application lock will be held until the script is finished running.
Applies To
Application Object
See Also
Lock
ASPError Object
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the ASPError object to obtain information about an error condition that has occurred in an
ASP script. The ASPError object is returned by the Server.GetLastError method. The ASPError
object exposes read-only properties.
Syntax
ASPError.property
Properties
ASPCode Returns an error code generated by IIS.
Number Returns the standard COM error code.
Source Indicates if the source of the error was internal to
ASP, the scripting language, or an object.
Active Server Pages Guide Page 501 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
When IIS encounters an error with either compiling or running an .asp file it will generate a 500;100
custom error. By default all Web sites and applications will transfer processing of a 500;100 custom
error to the file 500-100.asp which is installed by default to windir\Help\iisHelp\common. After a
500;100 custom error is generated, IIS will also create an instance of the ASPError object which
describes the error condition. The file 500-100.asp uses the properties of this object to display a page
describing the error condition. You can develop additional error processing by either modifying 500-
100.asp or by creating a new .asp file for processing errors.
Example
The following example is extracted from the file 500-100.asp and demonstrates writing the information
exposed by the ASPError object to a table.
<TABLE>
<TR><TD><font style="font:9pt/12pt verdana; color:black">ASP Code <TD><font style="font:9pt/12pt verdana; color:black"> <%= e.ASPCode %>
<TR><TD><font style="font:9pt/12pt verdana; color:black">Number <TD><font style="font:9pt/12pt verdana; color:black"> <%= e.Number %> (<%= Hex(e.Number) %>)
<TR><TD><font style="font:9pt/12pt verdana; color:black">Source <TD><font style="font:9pt/12pt verdana; color:black"> <%= e.Source %>
<TR><TD><font style="font:9pt/12pt verdana; color:black">FileName <TD><font style="font:9pt/12pt verdana; color:black"> <%= e.FileName %>
<TR><TD><font style="font:9pt/12pt verdana; color:black">LineNumber <TD><font style="font:9pt/12pt verdana; color:black"> <%= e.LineNumber %>
<TR><TD><font style="font:9pt/12pt verdana; color:black">Description <TD><font style="font:9pt/12pt verdana; color:black"> <%= e.Description %>
<TR><TD><font style="font:9pt/12pt verdana; color:black">ASP Description <TD><font style="font:9pt/12pt verdana; color:black"> <%= e.ASPDescription %>
</TABLE>
See Also
Server.GetLastError
ASPCode
This is preliminary documentation for IIS 5.0 and is subject to change.
The ASPCode property returns a string that contains an error code generated by IIS.
Syntax
ASPError.ASPCode ()
Applies To
FileName Indicates the name of the .asp file that was being
processed when the error occurred.
LineNumber Indicates the line within the .asp file that generated
the error.
Description Returns a short description of the error.
ASPDescription Returns a more detailed description of the error if
it is an ASP-related error.
Active Server Pages Guide Page 502 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ASPError Object
Number
This is preliminary documentation for IIS 5.0 and is subject to change.
The Number property returns a long integer that contains the error code returned by a COM
component. This will be a standard COM error code.
Syntax
ASPError.Number ()
Applies To
ASPError Object
Source
This is preliminary documentation for IIS 5.0 and is subject to change.
The Source property returns a string indicating if the error was generated by IIS, a scripting language, or
a component.
Syntax
ASPError.Source ()
Applies To
ASPError Object
FileName
This is preliminary documentation for IIS 5.0 and is subject to change.
The FileName property returns a string that indicates the .asp file that generated the error.
Syntax
ASPError.FileName ()
Active Server Pages Guide Page 503 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Applies To
ASPError Object
LineNumber
This is preliminary documentation for IIS 5.0 and is subject to change.
The LineNumber property returns a long integer indicating the number of the line within the .asp file that
generated the error.
Syntax
ASPError.LineNumber ()
Applies To
ASPError Object
Description
This is preliminary documentation for IIS 5.0 and is subject to change.
The Description property returns a string describing the error.
Syntax
ASPError.Description ()
Applies To
ASPError Object
ASPDescription
This is preliminary documentation for IIS 5.0 and is subject to change.
The ASPDescription property returns a string providing a more complete description of the error, if
available.
Syntax
Active Server Pages Guide Page 504 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ASPError.ASPDescription ()
Applies To
ASPError Object
ObjectContext Object
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the ObjectContext object to either commit or abort a transaction, managed by Component
Services, that has been initiated by a script contained in an ASP page.
When an .asp file contains the @TRANSACTION directive, the page runs in a transaction and does not
finish processing until the transaction either succeeds completely or fails.
Syntax
ObjectContext.method
Methods
Events
Remarks
ObjectContext implements two methods of the COM ObjectContext object. The SetAbort method
explicitly aborts the transaction. This causes Component Services to prevent any updates to resources
that were contacted during the first phase of the transaction. When the transaction aborts, the script's
OnTransactionAbort event will be processed.
Calling the SetComplete method does not necessarily mean that the transaction is complete. The
transaction will only complete if all of the transactional components called by the script call
SetComplete. In most instances, you will not need to call SetComplete within the script, as the script is
SetAbort The SetAbort method declares that the transaction initiated by the script
has not completed and the resources should not be updated.
SetComplete The SetComplete method declares that the script is not aware of any
reason for the transaction not to complete. If all components participating
in the transaction also call SetComplete, the transaction will complete.
OnTransactionAbort
OnTransactionCommit
Active Server Pages Guide Page 505 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
assumed to be complete if it finishes processing without calling SetAbort.
ObjectContext exposes methods in addition to SetAbort and SetComplete. These other methods are
not available to scripts in ASP scripts; however, they are available to components called by the script.
Example
The following example uses the SetAbort and SetComplete methods. The Sales.htm file obtains data
required to process a sales request. The second file, SalesVerify.asp contains a script that uses two
objects, Inventory and Sales, to process the sale. SetAbort is called if Inventory returns an error
code indicating that there is not sufficient inventory on hand to process the sale. If the Inventory object
does not return the error code, SetComplete is called and the sale is processed.
Sales.htm
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<TITLE>Sales Order</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF"><FONT FACE="ARIAL,HELVETICA">
<H2>Sales Order Form </H2>
<FORM METHOD=POST ACTION="SalesVerify.asp">
<P>Please enter the product code, quantity, and your account number.
<INPUT TYPE=TEXT NAME=QuantityToBuy>
<INPUT TYPE=TEXT NAME=ProductCode>
<INPUT TYPE=TEXT NAME=AccountIn>
<P>
<INPUT TYPE=SUBMIT>
</FONT>
</BODY>
</HTML>
SalesVerify.asp file
<%@ Transaction = Required %>
<%
Set CurrentQOH = Server.CreateObject("Mycomp.Inventory")
Set CurrentSales = Server.CreateObject("Mycomp.Sales")
CheckQuantity = Request("QuantityToBuy")
CheckProduct = Request("ProductCode")
QuantityStatus = CurrentQOH.CheckQOH(CheckQuantity,CheckProduct)
If QuantityStatus = None
ObjectContext.SetAbort
Response.Write "Sorry, there is not sufficient quantity on hand to
process your sale."
Else
ObjectContext.SetComplete
Account = Request("AccountIn")
Saleupdate = CurrentSales.PostIt(AccountIn)
End If
%>
Active Server Pages Guide Page 506 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
For more information, see Understanding Transactions and Processing Transactions.
ObjectContext Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The ObjectContext object exposes the following methods:
? SetAbort
? SetComplete
SetAbort
This is preliminary documentation for IIS 5.0 and is subject to change.
The SetAbort method aborts a transaction initiated by an .asp file.
Syntax
ObjectContext.SetAbort
Applies To
ObjectContext Object
SetComplete
This is preliminary documentation for IIS 5.0 and is subject to change.
The SetComplete method overrides any previous SetAbort method that has been called in a script.
Syntax
ObjectContext.SetComplete
Applies To
ObjectContext Object
ObjectContext Events
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 507 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following events can occur after an ObjectContext method:
? OnTransactionAbort
? OnTransactionCommit
OnTransactionAbort
This is preliminary documentation for IIS 5.0 and is subject to change.
The OnTransactionAbort event occurs if the transaction is aborted. When the OnTransactionAbort
event occurs, IIS will process the script's OnTransactionAbort subroutine, if it exists.
Example
The following example sends a response to the client with the transaction aborts:
<%@ TRANSACTION=Required LANGUAGE="VBScript" %>
<% Option Explicit
ObjectContext.SetAbort
Sub OnTransactionAbort
Response.Write "<p><b>The Transaction just aborted</b>."
Response.Write "This message came from the "
Response.Write "OnTransactionAbort() event handler."
end sub
%>
Applies To
ObjectContext Object
OnTransactionCommit
This is preliminary documentation for IIS 5.0 and is subject to change.
The OnTransactionCommit event occurs after a transactional script's transaction commits. When the
OnTransactionCommit event occurs, IIS will process the script's OnTransactionCommit subroutine,
if it exists.
Example
The following example sends a response to the client with the transaction commits:
<%@ TRANSACTION=Required LANGUAGE="VBScript" %>
<% Option Explicit
ObjectContext.SetComplete
Sub OnTransactionCommit
Response.Write "<p><b>The Transaction just committed</b>."
Response.Write "This message came from the "
Response.Write "OnTransactionCommit() event handler."
end sub
Active Server Pages Guide Page 508 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
%>
Applies To
ObjectContext Object
Request Object
This is preliminary documentation for IIS 5.0 and is subject to change.
The Request object retrieves the values that the client browser passed to the server during an HTTP
request.
Syntax
Request[.collection|property|method](variable)
Collections
Properties
Methods
Variable parameters are strings that specify the item to be retrieved from a collection or to be used as
input for a method or property. For more information about the variable parameter, see the individual
collection descriptions.
Remarks
If the specified variable is not in one of the preceding five collections, the Request object returns
EMPTY.
ClientCertificate The values of fields stored in the client certificate that is sent in the
HTTP request.
Cookies The values of cookies sent in the HTTP request.
Form The values of form elements in the HTTP request body.
QueryString The values of variables in the HTTP query string.
ServerVariables The values of predetermined environment variables.
TotalBytes Read-only; specifies the total number of bytes the client is sending in
the body of the request.
BinaryRead Retrieves data sent to the server from the client as part of a POST
request.
Active Server Pages Guide Page 509 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
All variables can be accessed directly by calling Request(variable) without the collection name. In this
case, the Web server searches the collections in the following order.
1. QueryString
2. Form
3. Cookies
4. ClientCertificate
5. ServerVariables
If a variable with the same name exists in more than one collection, the Request object returns the first
instance that the object encounters.
It is strongly recommended that when referring to members of a collection the full name be used. For
example, rather than Request.(AUTH_USER) use Request.ServerVariables(AUTH_USER). This
will allow the server to locate the item more quickly.
See Also
Response Object
Request Collections
This is preliminary documentation for IIS 5.0 and is subject to change.
The Request object contains the following collections.
? ClientCertificate
? Cookies
? Form
? QueryString
? ServerVariables
ClientCertificate
This is preliminary documentation for IIS 5.0 and is subject to change.
The ClientCertificate collection retrieves the certification fields (specified in the X.509 standard) from a
request issued by the Web browser.
If a Web browser uses the SSL3.0/PCT1 protocol (in other words, it uses a URL starting with https://
instead of http://) to connect to a server and the server requests certification, the browser sends the
certification fields.
If no certificate is sent, the ClientCertificate collection returns EMPTY.
Before you can use the ClientCertificate collection, you must configure your Web server to request
client certificates.
Active Server Pages Guide Page 510 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Syntax
Request.ClientCertificate( Key[SubField] )
Parameters
Key
Specifies the name of the certification field to retrieve. A client certificate consists of the following
fields.
SubField
Value Meaning
Certificate A string containing the binary stream of the entire certificate content in
ASN.1 format.
Flags A set of flags that provide additional client certificate information. The
following flags may be set:
ceCertPresentA client certificate is present.
ceUnrecognizedIssuerThe last certification in this chain is from an
unknown issuer.
NoteTo use the preceding flags you must include the client-certificate
include file in your ASP page. If you are using VBScript, include
cervbs.inc. If you are using JScript, include cerjavas.inc. These files are
installed in the \Inetpub\ASPSamp\Samples directory.
Issuer A string that contains a list of subfield values containing information about
the issuer of the certificate. If this value is specified without a SubField,
the ClientCertificate collection returns a comma-separated list of
subfields. For example, C=US, O=Verisign, and so on.
SerialNumber A string that contains the certification serial number as an ASCII
representation of hexadecimal bytes separated by hyphens (-). For
example, 04-67-F3-02.
Subject A string that contains a list of subfield values. The subfield values contain
information about the subject of the certificate. If this value is specified
without a SubField, the ClientCertificate collection returns a comma-
separated list of subfields. For example, C=US, O=Msft, and so on.
ValidFrom A date specifying when the certificate becomes valid. This date follows
VBScript format and varies with international settings. For example, in the
U.S., 9/26/96 11:59:59 PM. The year value is displayed as a four-digit
number.
ValidUntil A date specifying when the certificate expires. The year value is displayed
as a four-digit number.
Active Server Pages Guide Page 511 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
An optional parameter you can use to a retrieve an individual field in either the Subject or Issuer
keys. This parameter is added to the Key parameter as a suffix. For example, IssuerO or
SubjectCN. The following table lists some common SubField values.
SubField values other than those listed in the preceding table can be identified by their ASN.1 identifier.
The format of the ASN.1 identifier is a list of numbers separated by a period (.). For example,
3.56.7886.34.
Remarks
You can iterate through the keys of the ClientCertificate collection. This is demonstrated in the
following example.
<%
For Each strKey in Request.ClientCertificate
Response.Write strkey & " = " & Request.ClientCertificate(strkey) & "<BR>")
Next
%>
Example
The following example uses the Subject key to test whether a client certificate has been presented.
<%
If Len(Request.ClientCertificate("Subject")) = 0
Response.Write("No client certificate was presented")
End if
%>
The following example retrieves the common name of the company that issued the client certificate.
<%= Request.ClientCertificate("IssuerCN") %>
The following example checks the organization name of the subject of the client certification.
Value Meaning
C Specifies the name of the country of origin.
CN Specifies the common name of the user. (This subfield is only used with the
Subject key.)
GN Specifies a given name.
I Specifies a set of initials.
L Specifies a locality.
O Specifies the company or organization name.
OU Specifies the name of the organizational unit.
S Specifies a state or province.
T Specifies the title of the person or organization.
Active Server Pages Guide Page 512 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%
If (Request.ClientCertificate("Subject")="Msft")
Response.Write("Good Choice!")
End if
%>
The following example displays the expiration date of the client certificate.
This certification will expire on
<%= Request.ClientCertificate("ValidUntil") %>
The following example uses the Flags key to test whether the issuer of the certificate is known. The
include statement in the first line enables this script to use the named flag ceUnrecognizedIssuer.
<!--#include file="cervbs.inc" -->
<%
If Request.ClientCertificate("Flags") and ceUnrecognizedIssuer then
Response.Write "Unrecognized issuer"
End If
%>
Applies To
Request Object
See Also
Cookies, Form, QueryString, ServerVariables
Cookies
This is preliminary documentation for IIS 5.0 and is subject to change.
The Cookies collection enables you to retrieve the values of the cookies sent in an HTTP request.
Syntax
Request.Cookies(cookie)[(key)|.attribute]
Parameters
cookie
Specifies the cookie whose value should be retrieved.
key
An optional parameter used to retrieve subkey values from cookie dictionaries.
attribute
Specifies information about the cookie itself. The attribute parameter can be the following.
Active Server Pages Guide Page 513 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
You can access the subkeys of a cookie dictionary by including a value for key. If a cookie dictionary is
accessed without specifying key, all of the keys are returned as a single query string. For example, if
MyCookie has two keys, First and Second, and you do not specify either of these keys in a call to
Request.Cookies, the following string is returned.
First=firstkeyvalue&Second=secondkeyvalue
If two cookies with the same name are sent by the client browser, Request.Cookies returns the one
with the deeper path structure. For example, if two cookies had the same name but one had a path
attribute of /www/ and the other of /www/home/, the client browser would send both cookies to
the /www/home/ directory, but Request.Cookies would only return the second cookie.
To determine whether a cookie is a cookie dictionary (whether the cookie has keys), use the following
script.
<%= Request.Cookies("myCookie").HasKeys %>
If myCookie is a cookie dictionary, the preceding value evaluates to TRUE. Otherwise, it evaluates to
FALSE.
You can iterate through all the cookies in the Cookie collection, or all the keys in a cookie. However,
iterating through keys on a cookie that does not have keys will not produce any output. You can avoid
this situation by first checking to see whether a cookie has keys by using the .HasKeys syntax. This is
demonstrated in the following example:
<%
For Each strKey In Request.Cookies
Response.Write strKey & " = " & Request.Cookies(strKey) & "<BR>"
If Request.Cookies(strKey).HasKeys Then
For Each strSubKey In Request.Cookies(strKey)
Response.Write "->" & strKey & "(" & strSubKey & ") = " & _
Request.Cookies(strKey)(strSubKey) & "<BR>"
Next
End If
Next
%>
Example
The following example prints the value of myCookie in a Web page.
Here is the value of the cookie named myCookie:
<%= Request.Cookies("myCookie") %>
Name Description
HasKeys Read-only. Specifies whether the cookie contains keys.
Active Server Pages Guide Page 514 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
NoteCookies are described in detail in the HTTP state management specification, which is available at
WWW.W3.ORG.
Applies To
Request Object
See Also
ClientCertificate, Form, QueryString, ServerVariables
Form
This is preliminary documentation for IIS 5.0 and is subject to change.
The Form collection retrieves the values of form elements posted to the HTTP request body by a form
using the POST method.
Syntax
Request.Form(element)[(index)|.Count]
Parameters
element
Specifies the name of the form element from which the collection is to retrieve values.
index
An optional parameter that enables you to access one of multiple values for a parameter. It can be
any integer in the range 1 to Request.Form(parameter).Count.
Remarks
The Form collection is indexed by the names of the parameters in the request body. The value of
Request.Form(element) is an array of all of the values of element that occur in the request body. You
can determine the number of values of a parameter by calling Request.Form(element).Count. If a
parameter does not have multiple values associated with it, the count is 1. If the parameter is not found,
the count is 0.
To reference a single value of a form element that has multiple values, you must specify a value for index.
The index parameter may be any number between 1 and Request.Form(element).Count. If you
reference one of multiple form parameters without specifying a value for index, the data is returned as a
comma-delimited string.
When you use parameters with Request.Form, the Web server parses the HTTP request body and
returns the specified data. If your application requires unparsed data from the form, you can access it by
calling Request.Form without any parameters.
You can iterate through all the data values in a form request. For example, if a user filled out a form by
Active Server Pages Guide Page 515 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
specifying two values, Chocolate and Butterscotch, for the FavoriteFlavor element, you could retrieve
those values by using the following script.
<%
For i = 1 To Request.Form("FavoriteFlavor").Count
Response.Write Request.Form("FavoriteFlavor")(i) & "<BR>"
Next
%>
The preceding script would display the following.
Chocolate
Butterscotch
You can use this technique to display the parameter name, as shown in the following script.
<%
For i = 1 to Request.Form("FavoriteFlavor").count %>
Request.Form(FavoriteFlavor) = <%= Request.Form("FavoriteFlavor")(i)_
%> <BR>
<% Next %>
This script displays the following in the browser.
Request.Form(FavoriteFlavor) = Chocolate
Request.Form(FavoriteFlavor) = Butterscotch
Example
Consider the following form:
<FORM ACTION = "/scripts/submit.asp" METHOD = "post">
<P>Your first name: <INPUT NAME = "firstname" SIZE = 48>
<P>What is your favorite ice cream flavor: <SELECT NAME = "flavor">
<OPTION>Vanilla
<OPTION>Strawberry
<OPTION>Chocolate
<OPTION>Rocky Road</SELECT>
<P><INPUT TYPE = SUBMIT>
</FORM>
From that form, the following request body might be sent:
firstname=James&flavor=Rocky+Road
The following script can then be used:
Welcome, <%= Request.Form("firstname") %>.
Your favorite flavor is <%= Request.Form("flavor") %>.
Active Server Pages Guide Page 516 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following output is the result:
Welcome, James. Your favorite flavor is Rocky Road.
If the following script is used:
The unparsed form data is: <%= Request.Form %>
the output would be:
The unparsed form data is: firstname=James&flavor=Rocky+Road
NoteIf your form includes multiple objects with the same name (for example, HTML SELECT tags),
the item in the form collection will be a comma-delimited list of all the selected values.
Applies To
Request Object
See Also
ClientCertificate, Cookies, QueryString, ServerVariables
QueryString
This is preliminary documentation for IIS 5.0 and is subject to change.
The QueryString collection retrieves the values of the variables in the HTTP query string. The HTTP
query string is specified by the values following the question mark (?). Several different processes can
generate a query string. For example, the anchor tag
<A HREF= "example?string=this is a sample">string sample</A>
generates a variable named string with the value "this is a sample." Query strings are also generated by
sending a form, or by a user typing a query into the address box of the browser.
Syntax
Request.QueryString(variable)[(index)|.Count]
Parameters
variable
Specifies the name of the variable in the HTTP query string to retrieve.
index
An optional parameter that enables you to retrieve one of multiple values for variable. It can be
Active Server Pages Guide Page 517 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
any integer value in the range 1 to Request.QueryString(variable).Count.
Remarks
The QueryString collection is a parsed version of the QUERY_STRING variable in the
ServerVariables collection. It enables you to retrieve the QUERY_STRING variable by name. The
value of Request.QueryString(parameter) is an array of all of the values of parameter that occur in
QUERY_STRING. You can determine the number of values of a parameter by calling
Request.QueryString(parameter).Count. If a variable does not have multiple data sets associated
with it, the count is 1. If the variable is not found, the count is 0.
To reference a QueryString variable in one of multiple data sets, you specify a value for index. The
index parameter can be any value between 1 and Request.QueryString(variable).Count. If you
reference one of multiple QueryString variables without specifying a value for index, the data is
returned as a comma-delimited string.
When you use parameters with Request.QueryString, the server parses the parameters sent to the
request and returns the specified data. If your application requires unparsed QueryString data, you can
retrieve it by calling Request.QueryString without any parameters.
You can use an iterator to loop through all the data values in a query string. For example, if the following
request is sent
http://localhost/script/directory/NAMES.ASP?Q=Fred&Q=Sally
and Names.asp contained the following script,
---NAMES.ASP---
<%
For Each item In Request.QueryString("Q")
Response.Write Request.QueryString("Q")(item) & "<BR>"
Next
%>
Names.asp would display the following:
Fred
Sally
The preceding script could also have been written using Count.
<%
For i = 1 To Request.QueryString("Q").Count
Response.Write Request.QueryString("Q")(i) & "<BR>"
Next
%>
Example
The client request
Active Server Pages Guide Page 518 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
/scripts/directory-lookup.asp?name=fred&age=22
results in the following QUERY_STRING value:
name=fred&age=22.
The QueryString collection would then contain two members, name and age. You can then use the
following script:
Welcome, <%= Request.QueryString("name") %>.
Your age is <%= Request.QueryString("age") %>.
The output would be
Welcome, Fred. Your age is 22.
If the following script is used:
The unparsed query string is: <%=Request.QueryString %>
The output would be
The unparsed query string is: name=fred&age=22
Applies To
Request Object
See Also
ClientCertificate, Cookies, Form, ServerVariables
ServerVariables
This is preliminary documentation for IIS 5.0 and is subject to change.
The ServerVariables collection retrieves the values of predetermined environment variables.
Syntax
Request.ServerVariables (server environment variable)
Parameters
Active Server Pages Guide Page 519 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
server environment variable
Specifies the name of the server environment variable to retrieve. It can be one of the following
values.
Variable Description
ALL_HTTP All HTTP headers sent by the client.
ALL_RAW Retrieves all headers in raw form. The difference
between ALL_RAW and ALL_HTTP is that
ALL_HTTP places an HTTP_ prefix before the
header name and the header name is always
capitalized. In ALL_RAW the header name and
values appear as they are sent by the client.
APPL_MD_PATH Retrieves the metabase path for the Application
for the ISAPI DLL.
APPL_PHYSICAL_PATH Retrieves the physical path corresponding to the
metabase path. IIS converts the
APPL_MD_PATH to the physical (directory)
path to return this value.
AUTH_PASSWORD The value entered in the client's authentication
dialog. This variable is available only if Basic
authentication is used.
AUTH_TYPE The authentication method that the server uses to
validate users when they attempt to access a
protected script.
AUTH_USER Raw authenticated user name.
CERT_COOKIE Unique ID for client certificate, returned as a
string. Can be used as a signature for the whole
client certificate.
CERT_FLAGS bit0 is set to 1 if the client certificate is present.
bit1 is set to 1 if the cCertification authority of the
client certificate is invalid (it is not in the list of
recognized CAs on the server).
CERT_ISSUER Issuer field of the client certificate (O=MS,
OU=IAS, CN=user name, C=USA).
CERT_KEYSIZE Number of bits in Secure Sockets Layer
connection key size. For example, 128.
CERT_SECRETKEYSIZE Number of bits in server certificate private key.
For example, 1024.
CERT_SERIALNUMBER Serial number field of the client certificate.
CERT_SERVER_ISSUER Issuer field of the server certificate.
Active Server Pages Guide Page 520 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CERT_SERVER_SUBJECT Subject field of the server certificate.
CERT_SUBJECT Subject field of the client certificate.
CONTENT_LENGTH The length of the content as given by the client.
CONTENT_TYPE The data type of the content. Used with queries
that have attached information, such as the HTTP
queries GET, POST, and PUT.
GATEWAY_INTERFACE The revision of the CGI specification used by the
server. The format is CGI/revision.
HTTP_<HeaderName> The value stored in the header HeaderName.
Any header other than those listed in this table
must be prefixed by HTTP_ in order for the
ServerVariables collection to retrieve its value.
NoteThe server interprets any underscore (_)
characters in HeaderName as dashes in the
actual header. For example if you specify
HTTP_MY_HEADER, the server searches for a
header sent as MY-HEADER.
HTTP_ACCEPT Returns the value of the Accept header.
HTTP_ACCEPT_LANGUAGE Returns a string describing the language to use for
displaying content.
HTTP_USER_AGENT Returns a string describing the browser that sent
the request.
HTTP_COOKIE Returns the cookie string that was included with
the request.
HTTP_REFERER Returns a string containing the URL of the original
request when a redirect has occurred.
HTTPS Returns ON if the request came in through secure
channel (SSL) or it returns OFF if the request is
for a non-secure channel.
HTTPS_KEYSIZE Number of bits in Secure Sockets Layer
connection key size. For example, 128.
HTTPS_SECRETKEYSIZE Number of bits in server certificate private key.
For example, 1024.
HTTPS_SERVER_ISSUER Issuer field of the server certificate.
HTTPS_SERVER_SUBJECT Subject field of the server certificate.
Active Server Pages Guide Page 521 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
INSTANCE_ID The ID for the IIS instance in textual format. If the
instance ID is 1, it appears as a string. You can
use this variable to retrieve the ID of the Web-
server instance (in the metabase) to which the
request belongs.
INSTANCE_META_PATH The metabase path for the instance of IIS that
responds to the request.
LOCAL_ADDR Returns the Server Address on which the request
came in. This is important on multihomed
machines where there can be multiple IP
addresses bound to the machine and you want to
find out which address the request used.
LOGON_USER The Windows account that the user is logged into.
PATH_INFO Extra path information as given by the client. You
can access scripts by using their virtual path and
the PATH_INFO server variable. If this
information comes from a URL, it is decoded by
the server before it is passed to the CGI script.
PATH_TRANSLATED A translated version of PATH_INFO that takes
the path and performs any necessary virtual-to-
physical mapping.
QUERY_STRING Query information stored in the string following
the question mark (?) in the HTTP request.
REMOTE_ADDR The IP address of the remote host making the
request.
REMOTE_HOST The name of the host making the request. If the
server does not have this information, it will set
REMOTE_ADDR and leave this empty.
REMOTE_USER Unmapped user-name string sent in by the user.
This is the name that is really sent by the user, as
opposed to the names that are modified by any
authentication filter installed on the server.
REQUEST_METHOD The method used to make the request. For
HTTP, this is GET, HEAD, POST, and so on.
SCRIPT_NAME A virtual path to the script being executed. This is
used for self-referencing URLs.
SERVER_NAME The server's host name, DNS alias, or IP address
as it would appear in self-referencing URLs.
SERVER_PORT The port number to which the request was sent.
SERVER_PORT_SECURE A string that contains either 0 or 1. If the request
is being handled on the secure port, then this will
be 1. Otherwise, it will be 0.
Active Server Pages Guide Page 522 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
If a client sends a header other than those specified in the preceding table, you can retrieve the value of
that header by prefixing the header name with HTTP_ in the call to Request.ServerVariables. For
example, if the client sent the header
SomeNewHeader:SomeNewValue
you could retrieve SomeNewValue by using the following syntax:
<% Request.ServerVariables("HTTP_SomeNewHeader") %>
You can iterate through each server variable name. For example, the following script prints out all of the
server variables in a table:
<TABLE BORDER="1">
<TR><TD><B>Server Variable</B></TD><TD><B>Value</B></TD></TR>
<% For Each strKey In Request.ServerVariables %>
<TR><TD> <%= strKey %> </TD><TD> <%= Request.ServerVariables(strKey) %> </TD></TR>
<% Next %>
</TABLE>
Example
The following example uses the Request object to display several server variables:
<HTML>
<!-- This example displays the content of several ServerVariables. -->
ALL_HTTP server variable =
<%= Request.ServerVariables("ALL_HTTP") %> <BR>
CONTENT_LENGTH server variable =
<%= Request.ServerVariables("CONTENT_LENGTH") %> <BR>
CONTENT_TYPE server variable =
<%= Request.ServerVariables("CONTENT_TYPE") %> <BR>
QUERY_STRING server variable =
<%= Request.ServerVariables("QUERY_STRING") %> <BR>
SERVER_SOFTWARE server variable =
<%= Request.ServerVariables("SERVER_SOFTWARE") %> <BR>
</HTML>
The next example uses the ServerVariables collection to insert the name of the server into a hyperlink.
<A HREF = "http://<%= Request.ServerVariables("SERVER_NAME") %>
/scripts/MyPage.asp">Link to MyPage.asp</A>
SERVER_PROTOCOL The name and revision of the request information
protocol. The format is protocol/revision.
SERVER_SOFTWARE The name and version of the server software that
answers the request and runs the gateway. The
format is name/version.
URL Gives the base portion of the URL.
Active Server Pages Guide Page 523 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Applies To
Request Object
See Also
ClientCertificate, Cookies, Form, QueryString
Request Properties
This is preliminary documentation for IIS 5.0 and is subject to change.
The Request object supports this property:
? TotalBytes
TotalBytes
This is preliminary documentation for IIS 5.0 and is subject to change.
The TotalBytes property specifies the total number of bytes the client sent in the body of the request.
This property is Read-only.
Syntax
Counter = Request.TotalBytes
Parameters
Counter
Specifies a variable to receive the total number of bytes that the client sends in the request.
Example
The following script sets a variable equal to the total number of bytes included in a request object.
<%
Dim bytecount
bytecount = Request.TotalBytes
%>
Applies To
Request Object
See Also
Active Server Pages Guide Page 524 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
BinaryRead
Request Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The Request object supports the following method:
? BinaryRead
BinaryRead
This is preliminary documentation for IIS 5.0 and is subject to change.
The BinaryRead method retrieves data sent to the server from the client as part of a POST request.
This method retrieves the data from the client and stores it in a SafeArray. A SafeArray is an array that
contains information about the number of dimensions and the bounds of its dimensions.
Syntax
variant = Request.BinaryRead(count)
Parameters
variant
Contains an array of unsigned bytes returned by this method. This parameter will be of type
VT_ARRAY | VT_UI1, which is a variant array of unsigned one byte characters.
count
Before execution, specifies how many bytes to read from the client. After this method returns,
count will contain the number of bytes successfully read from the client. The total number of bytes
that will actually be read is less than or equal to Request.TotalBytes.
Remarks
The BinaryRead method is used to read the raw data sent by the client as part of a POST request. This
method is used for low-level access to this data, as opposed to, for example, using the Request.Form
collection to view form data sent in a POST request. Once you have called BinaryRead, referring to
any variable in the Request.Form collection will cause an error. Conversely, once you have referred to
a variable in the Request.Form collection, calling BinaryWrite will cause an error. Remember, if you
access a variable in the Request collection without specifying which subcollection it belongs to, the
Request.Form collection may be searched, bringing this rule into force.
Example
The following example uses the BinaryRead method to place the content of a request into a safe array.
Active Server Pages Guide Page 525 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%
Dim vntPostedData, lngCount
lngCount = Request.TotalBytes
vntPostedData = Request.BinaryRead(lngCount)
%>
Applies To
Request Object
See Also
TotalBytes, ClientCertificate, Cookies, Form, QueryString, ServerVariables
Response Object
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the Response object to send output to the client.
Syntax
Response.collection|property|method
Collections
Properties
Cookies Specifies cookie values. Using this collection, you can set cookie
values.
Buffer Indicates whether page output is buffered.
CacheControl Determines whether proxy servers are able to cache the output
generated by ASP.
Charset Appends the name of the character set to the content-type header.
ContentType Specifies the HTTP content type for the response.
Expires Specifies the length of time before a page cached on a browser
expires.
ExpiresAbsolute Specifies the date and time on which a page cached on a browser
expires.
IsClientConnected Indicates whether the client has disconnected from the server.
Active Server Pages Guide Page 526 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Methods
See Also
Request Object
Response Collections
This is preliminary documentation for IIS 5.0 and is subject to change.
The Response object has the following collection.
? Cookies
Cookies
This is preliminary documentation for IIS 5.0 and is subject to change.
The Cookies collection sets the value of a cookie. If the specified cookie does not exist, it is created. If
the cookie exists, it takes the new value and the old value is discarded.
Syntax
Response.Cookies(cookie)[(key)|.attribute] = value
Pics Set the value for the pics-label response header, to indicate the PICS
content rating.
Status The value of the status line returned by the server.
AddHeader Sets the HTML header name to value.
AppendToLog Adds a string to the end of the Web server log entry for this request.
BinaryWrite Writes the given information to the current HTTP output without any
character-set conversion.
Clear Erases any buffered HTML output.
End Stops processing the .asp file and returns the current result.
Flush Sends buffered output immediately.
Redirect Sends a redirect message to the browser, causing it to attempt to
connect to a different URL.
Write Writes a variable to the current HTTP output as a string.
Active Server Pages Guide Page 527 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Parameters
cookie
The name of the cookie.
key
An optional parameter. If key is specified, cookie is a dictionary, and key is set to value.
attribute
Specifies information about the cookie itself. The attribute parameter can be one of the following.
Value
Specifies the value to assign to key or attribute.
Remarks
If a cookie with a key is created, as in the following script,
<%
Response.Cookies("mycookie")("type1") = "sugar"
Response.Cookies("mycookie")("type2") = "ginger snap"
%>
this header is sent:
Set-Cookie:MYCOOKIE=TYPE1=sugar&TYPE2=ginger+snap
A subsequent assignment to myCookie without specifying a key, would destroy type1 and type2. This
is shown in the following example.
<% Response.Cookies("myCookie") = "chocolate chip" %>
In the preceding example, the keys type1 and type2 are destroyed and their values are discarded. The
myCookie cookie now has the value chocolate chip.
Name Description
Domain Write-only. If specified, the cookie is sent only to requests to this
domain.
Expires Write-only. The date on which the cookie expires. This date must be
set in order for the cookie to be stored on the client's disk after the
session ends. If this attribute is not set to a date beyond the current
date, the cookie will expire when the session ends.
HasKeys Read-only. Specifies whether the cookie contains keys.
Path Write-only. If specified, the cookie is sent only to requests to this path.
If this attribute is not set, the application path is used.
Secure Write-only. Specifies whether the cookie is secure.
Active Server Pages Guide Page 528 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Conversely, if you call a cookie with a key, it destroys any non-key values the cookie contained. For
example, if after the preceding code you call Response.Cookies with the following
<% Response.Cookies("myCookie")("newType") = "peanut butter" %>
The value chocolate chip is discarded and newType would be set to peanut butter.
To determine whether a cookie has keys, use the following syntax.
<%= Response.Cookies("myCookie").HasKeys %>
If myCookie is a cookie dictionary, the preceding value is TRUE. Otherwise, it is FALSE.
You can use an iterator to set cookie attributes. For example, to set all of the cookies to expire on a
particular date, use the following syntax.
<%
For Each cookie in Response.Cookies
Response.Cookie(cookie).ExpiresAbsolute = #July 4, 1997#
Next
%>
You can also iterate through the values of all the cookies in a collection, or all the keys in a cookie.
However, if you try to iterate through the values for a cookie that does not have keys, nothing will be
returned. To avoid this, you can first use the .HasKeys syntax to check whether a cookie has any keys.
This is demonstrated in the following example.
<%
If Not cookie.HasKeys Then
'Set the value of the cookie.
Response.Cookies(cookie) = ""
Else
'Set the value for each key in the cookie collection.
For Each key in Response.Cookies(cookie)
Response.Cookies(cookie)(key) = ""
Next
%>
Example
The following examples demonstrate how you can set a value for a cookie and assign values to its
attributes.
<%
Response.Cookies("Type") = "Chocolate Chip"
Response.Cookies("Type").ExpiresAbsolute = "July 31, 2001"
Response.Cookies("Type").Path = "/"
%>
Applies To
Active Server Pages Guide Page 529 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Response Object
See Also
Request.Cookies
Response Properties
This is preliminary documentation for IIS 5.0 and is subject to change.
The Response object has the following properties:
? Buffer
? CacheControl
? Charset
? ContentType
? Expires
? ExpiresAbsolute
? IsClientConnected
? PICS
? Status
Buffer
This is preliminary documentation for IIS 5.0 and is subject to change.
The Buffer property indicates whether to buffer page output. When page output is buffered, the server
does not send a response to the client until all of the server scripts on the current page have been
processed, or until the Flush or End method has been called.
The Buffer property cannot be set after the server has sent output to the client. For this reason, the call
to Response.Buffer should be the first line of the .asp file.
Syntax
Response.Buffer [= flag]
Parameters
flag
Specifies whether or not to buffer page output. It can be one of the following values.
Active Server Pages Guide Page 530 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
If the current .asp file has buffering set to TRUE and does not call the Flush method, the server will
honor Keep-Alive requests made by the client. This saves time because the server does not have to
create a new connection for each client request.
However, buffering prevents any of the response from being displayed to the client until the server has
finished all script processing for the current page. For long scripts, this may cause a perceptible delay.
You can use the ASPBufferingOn property in the metabase to set the default value for script buffering.
For more information about using the metabase, see Using IIS Admin Objects.
Applies To
Response Object
See Also
Flush, End
CacheControl
This is preliminary documentation for IIS 5.0 and is subject to change.
The CacheControl property overrides the Private default value. When you set this property to Public,
proxy servers can cache the output generated by ASP.
Syntax
Response.CacheControl [= Cache Control Header ]
Parameters
Cache Control Header
A cache control header that will be either Public or Private.
Value Description
FALSE No buffering. The server sends output to the client as it is processed.
This is the default value for versions of IIS up to and including 4.0. For
version 5.0 and later, the default value is True.
TRUE The server does not send output to the client until all of the ASP scripts
on the current page have been processed, or until the Flush or End
method has been called.
Active Server Pages Guide Page 531 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
Setting CacheControl to public may improve the perceived performance of your .asp files. If your .asp
file generates custom HTML for every request, you will not improve performance by setting
CacheControl to public. The values for Private and Public are strings, and must be enclosed in quotation
marks (" ").
Applies To
Response Object
Charset
This is preliminary documentation for IIS 5.0 and is subject to change.
The Charset property appends the name of the character set (for example, ISO-LATIN-7) to the
content-type header in the response object.
Syntax
Response.Charset(CharsetName)
Parameters
CharsetName
A string that specifies a character set for the page. The character set name will be appended to
the content-type header in the Response object.
Example
For an ASP page that did not include the Response.Charset property, the content-type header would
be
content-type:text/html
If the same .asp file included
<% Response.Charset= "ISO-LATIN-7" %>
Value Description
Private Only private caches may cache this page. This
is the default value. Most proxy servers will
not cache pages with this setting.
Public Public caches, such as proxy servers, will
cache pages with this setting.
Active Server Pages Guide Page 532 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
the content-type header would be
content-type:text/html; charset=ISO-LATIN-7
Remarks
This function inserts any string in the header, regardless of whether it represents a valid character set or
not.
If a single page contains multiple tags containing Response.Charset, each Response.Charset will
replace the previous CharsetName. As a result, the character set will be set to the value specified by the
last instance of Response.Charset in the page.
On Macintosh computers, the default U.S. character set is not ISO-LATIN-1. When serving up
documents, Personal Web Server for Macintosh automatically converts from the Macintosh character set
to ISO-Latin-1. In the U.S. version, all pages are assumed to be in the U.S. Macintosh character set
unless the Response.Charset is used. If Response.Charset is used to change the character set,
Personal Web Server for Macintosh does not convert the character set.
Applies To
Response Object
ContentType
This is preliminary documentation for IIS 5.0 and is subject to change.
The ContentType property specifies the HTTP content type for the response. If no ContentType is
specified, the default is text/HTML.
Syntax
Response.ContentType [= ContentType ]
Parameters
ContentType
A string describing the content type. This string is usually formatted type/subtype where type is
the general content category and subtype is the specific content type. For a full list of supported
content types, see your Web browser documentation or the current HTTP specification.
Example
The following example sets the content type to Channel Definition Format (CDF).
<% Response.ContentType = "application/x-cdf" %>
Active Server Pages Guide Page 533 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following examples set the ContentType property to other common values.
<% Response.ContentType = "text/HTML" %>
<% Response.ContentType = "image/GIF" %>
<% Response.ContentType = "image/JPEG" %>
<% Response.ContentType = "text/plain" %>
<% Response.ContentType = "image/JPEG" %>
Applies To
Response Object
Expires
This is preliminary documentation for IIS 5.0 and is subject to change.
The Expires property specifies the length of time before a page cached on a browser expires. If the user
returns to the same page before it expires, the cached version is displayed.
Syntax
Response.Expires [= number]
Parameters
number
The time in minutes before the page expires.
Remarks
When your .asp file calls Response.Expires, IIS creates an HTTP header indicating the time on the
server. If the system time on the client is earlier than the system time on the server (due to either the client
or server having an inaccurate time setting, or time-zone differences) setting the parameter to 0 will not
have the effect of expiring the page immediately. You can use the Response.ExpiresAbsolute property
to achieve immediate expiration of a page. In addition, you can use a negative number for the Expires
property. For example
<%Response.Expires = -1 %>
will expire the response immediately.
If there are multiple calls to Response.Expires on a single page, the server will use the shortest time
period.
Applies To
Response Object
See Also
Active Server Pages Guide Page 534 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ExpiresAbsolute
ExpiresAbsolute
This is preliminary documentation for IIS 5.0 and is subject to change.
The ExpiresAbsolute property specifies the date and time at which a page cached on a browser
expires. If the user returns to the same page before that date and time, the cached version is displayed. If
a time is not specified, the page expires at midnight of that day. If a date is not specified, the page expires
at the given time on the day that the script is run.
Syntax
Response.ExpiresAbsolute [= [date] [time]]
Parameters
date
Specifies the date on which the page will expire. The value sent in the expires header conforms to
the RFC-1123 date format.
time
Specifies the time at which the page will expire. This value is converted to GMT before an Expires
header is sent.
Remarks
If this property is set more than once on a page, the earliest expiration date or time is used.
Example
The following example specifies that the page will expire 15 seconds after 1:30 PM on May 31, 2001.
<% Response.ExpiresAbsolute=#May 31,2001 13:30:15# %>
Applies To
Response Object
See Also
Expires
IsClientConnected
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 535 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The IsClientConnected property is a read-only property that indicates if the client has disconnected
from the server.
Syntax
Response.IsClientConnected ( )
Remarks
This property allows you greater control over circumstances where the client may have disconnected
from the server. For example, if a long period of time has elapsed between when a client request was
made and when the server responded, it may be beneficial to make sure the client is still connected
before continuing to process the script.
Example
<%
'Check to see if the client is connected.
If Not Response.IsClientConnected Then
'Get the sessionid to send to the shutdown function.
Shutdownid = Session.SessionID
'Perform shutdown processing.
Shutdown(Shutdownid)
End If
%>
Applies To
Response Object
PICS
This is preliminary documentation for IIS 5.0 and is subject to change.
The PICS property adds a value to the pics-label response header.
Syntax
Response.PICS(PICSLabel)
Parameters
PICSLabel
A string that is a properly formatted PICS label. The value specified by PICSLabel will be
appended to the pics-label response header.
Example
Active Server Pages Guide Page 536 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
For an .asp file that includes
<%
Response.PICS("(PICS-1.1 <http://www.rsac.org/ratingv01.html> labels on " & chr(34) & "1997.01.05T08:15-0500" & chr(34) & " until" & chr(34) & "1999.12.31T23:59-0000" & chr(34) & " ratings (v 0 s 0 l 0 n 0))")
%>
the following header would be added:
PICS-label:(PICS-1.1 <http://www.rsac.org/ratingv01.html> labels on "1997.01.05T08:15-0500" until "1999.12.31T23:59-0000" ratings (v 0 s 0 l 0 n 0))
Remarks
The PICS property inserts any string in the header, whether or not it represents a valid PICS label.
If a single page contains multiple tags containing Response.PICS, each instance will replace the PICS
label set by the previous one. As a result, the PICS label will be set to the value specified by the last
instance of Response.PICS in the page.
Because PICS labels contain quotes, you must replace each quote with " & chr(34) & ".
Applies To
Response Object
Status
This is preliminary documentation for IIS 5.0 and is subject to change.
The Status property specifies the value of the status line returned by the server. Status values are defined
in the HTTP specification.
Syntax
Response.Status = StatusDescription
Parameters
StatusDescription
A string that consists of both a three-digit number that indicates a status code and a brief
explanation of that code. For example, 310 Move Permanently.
Remarks
Use this property to modify the status line returned by the server.
Example
The following example sets the response status.
Active Server Pages Guide Page 537 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<% Response.Status = "401 Unauthorized" %>
Applies To
Response Object
Response Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The Response object has the following methods.
? AddHeader
? AppendToLog
? BinaryWrite
? Clear
? End
? Flush
? Redirect
? Write
AddHeader
This is preliminary documentation for IIS 5.0 and is subject to change.
The AddHeader method adds an HTML header with a specified value. This method always adds a new
HTTP header to the response. It will not replace an existing header of the same name. Once a header
has been added, it cannot be removed.
If another Response method will provide the functionality you require, it is recommended that you use
that method instead.
Syntax
Response.AddHeader name, value
Parameters
name
The name of the new header variable.
value
The initial value stored in the new header variable.
Remarks
Active Server Pages Guide Page 538 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
To avoid name ambiguity, name should not contain any underscore (_) characters. The
ServerVariables collection interprets underscores as dashes in the header name. For example, the
following script causes the server to search for a header named MY-HEADER.
<% Request.ServerVariables("HTTP_MY_HEADER") %>
Because the HTTP protocol requires that all headers be sent before content, in general you must modify
all outgoing headers before your ASP script generates any output. In IIS 4.0, this meant that you had to
call AddHeader in your script before any output (such as that generated by HTML code or the Write
method) was sent to the client.
However, with IIS 5.0, response buffering (enabled by the metabase property AspBufferingOn) is on
by default. Therefore, you can call the AddHeader method at any point in the script, as long as it
precedes any calls to Flush.
The following .asp file illustrates this point.
<HTML>
Here's some text on your Web page.
<% Response.AddHeader "WARNING", "Error Message Text" %> Here's some more interesting and illuminating text.
<% Response.Flush %>
<% Response.Write("some string") %>
</HTML>
In the preceding example, because the page is buffered by default, the server will not send output to the
client until all the scripts on the ASP page have been processed or until the Flush method is called. With
buffered output, calls to AddHeader can appear anywhere the script, so long as they precede any calls
to Flush. If the call to AddHeader appeared below the call to Flush in the preceding example, the
script would generate a run-time error.
You can use this method to send multiple copies of the same header with different values, as with
WWW-Authenticate headers.
Example
The following example uses the AddHeader method to request that the client use Basic authentication.
<% Response.Addheader "WWW-Authenticate", "BASIC" %>
NoteThe preceding script merely informs the client browser which authentication to use. If you use this
script in your Web applications, you should ensure that the Web server has Basic authentication enabled.
Applies To
Response Object
See Also
Flush, Write, Buffer
Active Server Pages Guide Page 539 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
AppendToLog
This is preliminary documentation for IIS 5.0 and is subject to change.
The AppendToLog method adds a string to the end of the Web server log entry for this request. You
can call it multiple times in one section of script. Each time the method is called it appends the specified
string to the existing entry.
Syntax
Response.AppendToLog string
Parameters
string
The text to append to the log file. Because fields in the log are comma-delimited, this string cannot
contain any comma characters (,).
Remarks
In order for the specified string to be recorded in the log file, you must enable the URI Stem option of
the Extended Properties property sheet for the site whose activity you wish to log.
Example
The following example adds the text "content updated" to the log file.
<% Response.AddToLog "My custom log message" %>
Applies To
Response Object
BinaryWrite
This is preliminary documentation for IIS 5.0 and is subject to change.
The BinaryWrite method writes the specified information to the current HTTP output without any
character conversion. This method is useful for writing non-string information such as binary data
required by a custom application.
Syntax
Response.BinaryWrite data
Parameters
data
The data to write to the HTTP output. This parameter will be of type VT_ARRAY | VT_UI1,
Active Server Pages Guide Page 540 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
which is a variant array of unsigned one-byte characters.
Example
If you have an object that generates an array of bytes, you can use the following call to BinaryWrite to
send the bytes to a custom application.
<%
Set objBinaryGen = Server.CreateObject("MyComponents.BinaryGenerator")
vntPicture = objBinaryGen.MakePicture
Response.BinaryWrite vntPicture
%>
Applies To
Response Object
See Also
Write
Clear
This is preliminary documentation for IIS 5.0 and is subject to change.
The Clear method erases any buffered HTML output. However, the Clear method erases only the
response body; it does not erase response headers. You can use this method to handle error cases. Note
that this method will cause a run-time error if Response.Buffer has not been set to TRUE.
Syntax
Response.Clear
Applies To
Response Object
See Also
End, Flush
End
This is preliminary documentation for IIS 5.0 and is subject to change.
The End method causes the Web server to stop processing the script and return the current result. The
remaining contents of the file are not processed.
Syntax
Active Server Pages Guide Page 541 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Response.End
Remarks
If Response.Buffer has been set to TRUE, calling Response.End will flush the buffer. If you do not
want output returned to the user, you should call Response.Clear first.
<%
Response.Clear
Response.End
%>
Applies To
Response Object
See Also
Buffer, Clear
Flush
This is preliminary documentation for IIS 5.0 and is subject to change.
The Flush method sends buffered output immediately. This method will cause a run-time error if
Response.Buffer has not been set to TRUE.
Syntax
Response.Flush
Remarks
If the Flush method is called on an ASP page, the server does not honor Keep-Alive requests for that
page.
Applies To
Response Object
Redirect
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 542 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The Redirect method causes the browser to attempt to connect to a different URL.
Syntax
Response.Redirect URL
Parameters
URL
The Uniform Resource Locator that the browser is redirected to.
Remarks
Any response body content set explicitly in the page is ignored. However, this method does send other
HTTP headers set by this page to the client. An automatic response body containing the redirect URL as
a link is generated. The Redirect method sends the following explicit header, where URL is the value
passed to the method.
HTTP 1.0 302 Object Moved
Location URL
Example
The following example redirects the user to Microsofts primary Web site.
<% Response.Redirect "http://www.microsoft.com" %>
Applies To
Response Object
Write
This is preliminary documentation for IIS 5.0 and is subject to change.
The Write method writes a specified string to the current HTTP output.
Syntax
Response.Write variant
Parameters
variant
The data to write. This parameter can be any data type supported by the Visual Basic Scripting
Edition VARIANT data type, including characters, strings, and integers. This value cannot contain
the character combination %>; instead you should use the escape sequence %\>. The Web server
Active Server Pages Guide Page 543 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
will translate the escape sequence when it processes the script.
Example
The following examples use the Response.Write method to send output to the client.
I just want to say <% Response.Write "Hello World." %>
Your name is: <% Response.Write Request.Form("name") %>
The following example adds an HTML tag to the Web page output. Because the string returned by the
Write method cannot contain the character combination %>, the escape %\> has been used instead.
The following script
<% Response.Write "<TABLE WIDTH = 100%\>" %>
produces the output
<TABLE WIDTH = 100%>
Applies To
Response Object
See Also
BinaryWrite
Server Object
This is preliminary documentation for IIS 5.0 and is subject to change.
The Server object provides access to methods and properties on the server. Most of these methods and
properties serve as utility functions.
Syntax
Server.property|method
Properties
Methods
ScriptTimeout The amount of time that a script can run before it times out.
Active Server Pages Guide Page 544 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Server Properties
This is preliminary documentation for IIS 5.0 and is subject to change.
The Server object has the following property:
? ScriptTimeout
ScriptTimeout
This is preliminary documentation for IIS 5.0 and is subject to change.
The ScriptTimeout property specifies the maximum amount of time a script can run before it is
terminated.
The timeout will not take effect while a server component is processing.
Syntax
Server.ScriptTimeout = NumSeconds
Parameters
NumSeconds
Specifies the maximum number of seconds that a script can run before the server terminates it. The
default value is 90 seconds.
Remarks
A default ScriptTimeout can be set for a Web service or Web server by using the AspScriptTimeout
property in the metabase. The ScriptTimeout property cannot be set to a value less than that specified
CreateObject Creates an instance of a server component.
Execute Executes an .asp file.
GetLastError Returns an ASPError object that describes the error condition.
HTMLEncode Applies HTML encoding to the specified string.
MapPath Maps the specified virtual path, either the absolute path on the current
server or the path relative to the current page, into a physical path.
Transfer Sends all of the current state information to another .asp file for
processing.
URLEncode Applies URL encoding rules, including escape characters, to the string.
Active Server Pages Guide Page 545 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
in the metabase. For example, if NumSeconds is set to 10, and the metabase setting contains the default
value of 90 seconds, scripts will time out after 90 seconds. However, if NumSeconds were set to 100,
the scripts would time out after 100 seconds.
For more information about using the metabase, see Using IIS Admin Objects.
Example
The following example causes scripts to time out if the server takes longer than 100 seconds to process
them:
<% Server.ScriptTimeout = 100 %>
The following example retrieves the current value of the ScriptTimeout property and stores it in the
variable TimeOut.
<% TimeOut = Server.ScriptTimeout %>
Applies To
Server Object
See Also
AspScriptTimeout
Server Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The Server object has the following methods.
? CreateObject
? Execute
? GetLastError
? HTMLEncode
? MapPath
? Transfer
? URLEncode
CreateObject
This is preliminary documentation for IIS 5.0 and is subject to change.
The CreateObject method creates an instance of a server component. If the component has
implemented the OnStartPage and OnEndPage methods, the OnStartPage method is called at this
time. For more information about server components, see Installable Components for ASP.
Active Server Pages Guide Page 546 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Syntax
Server.CreateObject( progID )
Parameters
progID
Specifies the type of object to create. The format for progID is [Vendor.]Component[.Version].
Remarks
By default, objects created by the Server.CreateObject method have page scope. This means that they
are automatically destroyed by the server when it finishes processing the current ASP page.
To create an object with session or application scope, you can either use the <OBJECT> tag in the
Global.asa file and set the SCOPE attribute to SESSION or APPLICATION, or store the object in a
session or application variable.
For example, an object stored in a session variable, as shown in the following script, is destroyed when
the Session object is destroyed. That is, when the session times out, or the Abandon method is called.
<% Set Session("ad") = Server.CreateObject("MSWC.AdRotator")%>
You can also destroy the object by setting the variable to Nothing or setting the variable to a new value,
as shown below. The first example releases the object ad. The second replaces ad with a string.
<% Session("ad") = Nothing %>
<% Session("ad") = "some other value" %>
You cannot create an object instance with the same name as a built-in object. For example, the following
returns an error.
<% Set Response = Server.CreateObject("Response") %>
Example
<% Set MyAd = Server.CreateObject("MSWC.AdRotator") %>
The preceding example creates a server component, MyAd, as a MSWC.AdRotator component that
can be used to automate rotation of advertisements on a Web page.
For more information about server components, see Building Components for ASP.
Applies To
Server Object
Active Server Pages Guide Page 547 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Execute
This is preliminary documentation for IIS 5.0 and is subject to change.
The Execute method calls an .asp file and processes it as if it were part of the calling ASP script. The
Execute method is similar to a procedure call in many programming languages.
Syntax
Server.Execute( Path )
Parameters
Path
A string specifying the location of the .asp file to execute. If an absolute path is specified for this
parameter then it must be for an .asp file within the same application space.
Remarks
The Server.Execute method provides a way of dividing a complex application into individual modules.
By employing the Server.Execute method, you can develop a library of .asp files that you can call as
needed. This approach is an alternative to server-side includes.
After IIS processes the .asp file specified in the input parameter to Server.Execute, the response is
returned to the calling ASP script. The executed .asp file may modify HTTP headers. However, as with
any .asp file, if the executed .asp file attempts to modify HTTP headers after it sends a response to the
client, it will generate an error.
The path parameter may be for either an absolute or a relative path. If the path is absolute, it must map to
an ASP script in the same application as the calling .asp file.
The path parameter may contain a query string.
If either the calling or called .asp file contains a transaction directive, the status of the transaction will
apply to the .asp file which contains the directive. For example, if ASP1 below calls ASP2 and the
transaction is aborted while ASP2 is being processed, ASP2's OnTransactionAbort (if present) will be
called. After ASP2 completes processing, ASP1's OnTransactionAbort (if present) will be called.
ASP1:
<%@ Transaction=Required%>
<%
Server.Execute ("Page22.asp")
Sub OnTransactionAbort
Sub OnTransactionCommit
%>
Asp2.asp:
<%@
Transaction=Required
Active Server Pages Guide Page 548 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Sub OnTransactionAbort
Sub OnTransactionCommit
%>
Example
The following example demonstrates executing an .asp file that returns some text. The output from these
two scripts is:
I am going to ASP2
Here I am
ASP1
<HTML><BODY><% Response.Write("I am going to execute ASP2 <BR>")
Server.Execute("/myasps/asp2.asp")
%>
</BODY>
</HTML>
ASP2
<HTML><BODY><% Response.Write("Here I am")%></BODY></HTML>
Applies to
Server Object
See Also
Transfer, OnTransactionAbort, OnTransactionCommit
GetLastError
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetLastError method returns an ASPError Object describing the error condition that occurred.
This method is available only before the .asp file has sent any content to the client.
Syntax
Server.GetLastError ()
Remarks
If a 500;100 custom error has been defined for an ASP application, it may refer to an .asp file. In this
case, when an error occurs during the running of an .asp file within the application, the server will
automatically transfer to this ASP page via the Server.Transfer method. All of the state information
Active Server Pages Guide Page 549 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
from the executing ASP application will be available to the .asp file that is handling the error. In addition,
the ASPError Object will be available, so you can expose the properties of the error through the .asp
file that you set up to handle the error.
The default Web site is configured to use the file \iishelp\common\500-100.asp. You can either use this
file for processing ASP errors, or create your own. If you want to change the .asp file for processing the
500;100 custom errors you can use the Internet Information Services snap-in.
NoteA 500;100 custom error will be generated if IIS encounters an error while processing either
an .asp file or the application's Global.asa file.
Example
The following three examples demonstrate different sorts of errors that will generate a 500;100 custom
error. The three types of errors are:
? Pre-processing errors
? Script compiling errors
? Run-time errors
The first example demonstrates a pre-processing error, which IIS will generate when it tries to include
the file. This error will be generated because the include statement is missing the file parameter for the
include statement. The second example demonstrates a script compiling error. The scripting engine will
not compile this script because it is missing the keyword "next" in a For...Next loop. The third example
demonstrates a run-time error that will be caught because the script attempts to divide by 0.
Example 1
<!--#include fil=inc.h -->
<%
response.write "hello"
%>
Example 2
<%
dim I
for i=1 to 1
nxt
%>
Example 3
<%
dim i,j
dim sum
sum=0
j=0
for i=1 to 10
sum=sum+1
next
sum=sum/j
%>
Active Server Pages Guide Page 550 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Applies To
Server Object
See Also
ASPError Object
HTMLEncode
This is preliminary documentation for IIS 5.0 and is subject to change.
The HTMLEncode method applies HTML encoding to a specified string.
Syntax
Server.HTMLEncode( string )
Parameters
string
Specifies the string to encode.
Example
The following script
<%= Server.HTMLEncode("The paragraph tag: <P>") %>
produces the output
The paragraph tag: <P>
NoteThe preceding output will be displayed by a Web browser as
The paragraph tag: <P>
If you view source, or open the page as a text file, you will be able to see the encoded HTML.
Applies To
Server Object
See Also
URLEncode
Active Server Pages Guide Page 551 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
MapPath
This is preliminary documentation for IIS 5.0 and is subject to change.
The MapPath method maps the specified relative or virtual path to the corresponding physical directory
on the server.
Syntax
Server.MapPath( Path )
Parameters
Path
Specifies the relative or virtual path to map to a physical directory. If Path starts with either a
forward (/) or backward slash (\), the MapPath method returns a path as if Path is a full virtual
path. If Path doesn't start with a slash, the MapPath method returns a path relative to the
directory of the .asp file being processed.
Remarks
The MapPath method does not check whether the path it returns is valid or exists on the server.
Because the MapPath method maps a path regardless of whether the specified directories currently
exist, you can use the MapPath method to map a path to a physical directory structure, and then pass
that path to a component that creates the specified directory or file on the server.
You can use the relative path syntax for the Path parameter if the AspEnableParentPaths property is set
to TRUE (which is the default value). If you are concerned about allowing scripts to access the physical
directory structure, you can disable this feature by setting the AspEnableParentPaths property to
FALSE. You can accomplish this with either the Internet Information Services snap-in or with a script.
Example
For the examples below, the file data.txt is located in the directory, C:\Inetpub\Wwwroot\Script, as is the
test.asp file that contains the following scripts. The C:\Inetpub\Wwwroot directory is set as the server's
home directory.
The following example uses the server variable PATH_INFO to map the physical path of the current file.
The following script
<%= server.mappath(Request.ServerVariables("PATH_INFO"))%><BR>
produces the output
c:\inetpub\wwwroot\script\test.asp<BR>
Active Server Pages Guide Page 552 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Because the path parameters in the following examples do not start with a slash character, they are
mapped relative to the current directory, in this case C:\Inetpub\Wwwroot\Script. The following scripts
<%= server.mappath("data.txt")%><BR>
<%= server.mappath("script/data.txt")%><BR>
produce the following output
c:\inetpub\wwwroot\script\data.txt<BR>
c:\inetpub\wwwroot\script\script\data.txt<BR>
The next two examples use the slash characters to specify that the path returned should be looked up as
complete virtual paths on the server. The following scripts
<%= server.mappath("/script/data.txt")%><BR>
<%= server.mappath("\script")%><BR>
produce the following output
c:\inetpub\wwwroot\script\data.txt<BR>
c:\inetpub\wwwroot\script<BR>
The following examples demonstrate how you can use either a forward slash (/) or a backslash (\) to
return the physical path to the home directory. The following scripts
<%= server.mappath("/")%><BR>
<%= server.mappath("\")%><BR>
produce the following output
c:\inetpub\wwwroot<BR>
c:\inetpub\wwwroot<BR>
Applies To
Server Object
See Also
AspEnableParentPaths
Transfer
This is preliminary documentation for IIS 5.0 and is subject to change.
The transfer method sends all of the information that has been assembled for processing by one .asp
Active Server Pages Guide Page 553 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
file, to a second .asp file.
Syntax
Server.Transfer (path)
Parameters
Path
The location of the .asp file to which control should be transferred.
Remarks
When you call Server.Transfer the state information for all the built-in objects will be included in the
transfer. This means that any variables or objects that have been assigned a value in the current page,
during the current session, or within the current application-state, will be maintained. In addition, all of the
current contents for the request collections will be available to the .asp file receiving the transfer.
If the path you specify in the input parameter is for an .asp file in another application, the .asp file will
execute as if it were in the application that contains the Server.Transfer command. In other words, all
variables and objects that have been given application scope either by other .asp files in the application
or by the application's Global.asa file will be available to the called .asp file.
Example
The following example demonstrates transferring from one .asp file to another .asp file, and sending the
session identifier to the client.
The output from these scripts will be:
A session ID
I am going to ASP2
The same session ID
ASP1
<HTML><BODY><% Dim sessvar1 Response.Write Session.SessionID
Response.Write ("<BR>")
Response.Write("I am going to ASP2 <BR>")
Server.Transfer("/Myasps/ASP2.asp")
%>
ASP2
<HTML>
<BODY><% Response.Write Session.SessionID %></BODY></HTML>
Applies To
Active Server Pages Guide Page 554 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Server Object
See Also
Execute, Global.asa Reference, Application Object
URLEncode
This is preliminary documentation for IIS 5.0 and is subject to change.
The URLEncode method applies URL encoding rules, including escape characters, to a specified string.
Syntax
Server.URLEncode( string )
Parameters
string
Specifies the string to encode.
Example
The following script
<%Response.Write(Server.URLEncode("http://www.microsoft.com")) %>
produces the output
https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fwww%2Emicrosoft%2Ecom
Applies To
Server Object
See Also
HTMLEncode
Session Object
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the Session object to store information needed for a particular user-session. Variables
stored in the Session object are not discarded when the user jumps between pages in the application;
Active Server Pages Guide Page 555 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
instead, these variables persist for the entire user-session.
The Web server automatically creates a Session object when a Web page from the application is
requested by a user who does not already have a session. The server destroys the Session object when
the session expires or is abandoned.
One common use for the Session object is to store user preferences. For example, if a user indicates
that they prefer not to view graphics, you could store that information in the Session object. For more
information on using the Session object, see Managing Sessions in the ASP Applications section.
NoteSession state is only maintained for browsers that support cookies.
Syntax
Session.collection|property|method
Collections
Properties
Methods
Events
Scripts for the following events are declared in the Global.asa file.
For more information about these events and the Global.asa file, see the Global.asa Reference.
Contents Contains the items that you have added to the session with script
commands.
StaticObjects Contains the objects created with the <OBJECT> tag and given session
scope.
CodePage The code page that will be used for symbol mapping.
LCID The locale identifier.
SessionID Returns the session identification for this user.
Timeout The timeout period for the session state for this application, in minutes.
Abandon This method destroys a Session object and releases its resources.
Contents.Remove This method deletes an item from the Contents collection.
Contents.RemoveAll This method deletes all items from the Contents collection.
Session_OnEnd
Session_OnStart
Active Server Pages Guide Page 556 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
You can store values in the Session object. Information stored in the Session object is available
throughout the session and has session scope. The following script demonstrates storage of two types of
variables.
<%
Session("username") = "Janine"
Session("age") = 24
%>
However, if you store an object in the Session object and use VBScript as your primary scripting
language, you must use the Set keyword. This is illustrated in the following script.
<% Set Session("Obj1") = Server.CreateObject("MyComponent.class1") %>
You can then call the methods and properties exposed by MyComponent.class1 on subsequent Web
pages, by using the following.
<% Session("Obj1").MyMethod %>
Or by extracting a local copy of the object and using the following.
<%
Set MyLocalObj1 = Session("Obj1")
MyLocalObj1.MyObjMethod
%>
Another way to create objects with session scope is to use the <OBJECT> tags in the Global.asa file.
You cannot, however, store a built-in object in a Session object. For example, each of the following
lines would return an error.
<%
Set Session("var1") = Session
Set Session("var2") = Request
Set Session("var3") = Response
Set Session("var4") = Server
Set Session("var5") = Application
%>
Before you store an object in the Session object, you should know what threading model it uses. Only
objects marked as both can be stored in the Session object without locking the session to a single
thread.
If you store an array in a Session object, you should not attempt to alter the elements of the stored array
directly. For example, the following script will not work:
<% Session("StoredArray")(3) = "new value" %>
Active Server Pages Guide Page 557 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is because the Session object is implemented as a collection. The array element StoredArray(3)
does not receive the new value. Instead, the value is indexed into the collection, overwriting any
information stored at that location.
It is strongly recommended that if you store an array in the Session object, you retrieve a copy of the
array before retrieving or changing any of the elements of the array. When you are done with the array,
you should store the array in the Session object again so that any changes you made are saved. This is
demonstrated in the following example:
---file1.asp---
<%
'Creating and initializing the array
Dim MyArray()
Redim MyArray(5)
MyArray(0) = "hello"
MyArray(1) = "some other string"
'Storing the array in the Session object.
Session("StoredArray") = MyArray
Response.Redirect("file2.asp")
%>
---file2.asp---
<%
'Retrieving the array from the Session Object
'and modifying its second element.
LocalArray = Session("StoredArray")
LocalArray(1) = " there"
'Printing out the string "hello there."
Response.Write(LocalArray(0)&LocalArray(1))
'Re-storing the array in the Session object.
'This overwrites the values in StoredArray with the new values.
Session("StoredArray") = LocalArray
%>
Example
The following code assigns the string MyName to a session variable called name, assigns a value to a
session variable called year, and assigns an instance of the some.Obj component to a variable called
myObj.
Session("name") = "MyName"
Session("year") = 96
Set Session("myObj") = Server.CreateObject("someObj")
%>
For more information, see Managing Sessions.
Active Server Pages Guide Page 558 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Session Collections
This is preliminary documentation for IIS 5.0 and is subject to change.
The Session Object supports the following collections:
? Contents
? StaticObjects
Session Contents Collection
This is preliminary documentation for IIS 5.0 and is subject to change.
The Session.Contents collection contains all of the items that have been established for a session
without using the <OBJECT> tag. The collection can be used to determine the value of a specific session
item, or to iterate through the collection and retrieve a list of all items in the session.
Syntax
Session.Contents( Key )
Parameters
Key
The name of the property to retrieve.
Remarks
You can use an iterating control structure to loop through the keys of the Contents collection. This is
demonstrated in the following example.
<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim sessitem
Dim anArray(2)
response.write "SessionID: " & Session.SessionID & "<P>"
anArray(0)="one"
anArray(1)="second"
anArray(2)="third"
Session("anArray")=anArray
Session("scalar")="1234567890ABCDEFG"
set objConn=server.createobject("adodb.connection")
set Session("object")=objConn
response.write "List of " & Session.Contents.Count & " items in Session
contents collection:<HR>"
For Each sessitem in Session.Contents
If IsObject(Session.Contents(sessitem)) Then
Active Server Pages Guide Page 559 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Response.write(sessitem & " : Session object cannot be displayed." & "<BR>")
Else
If IsArray(Session.Contents(sessitem)) Then
Response.write "Array named " & Session.Content(sessitem) & "<ol>"
For each objArray in Session.Contents(sessitem)
Response.write "<li>" & _
Session.Contents(sessitem)(objArray)& "<BR>"
Next
Response.write "</ol>"
Else
Response.write(sessitem & " : " & Session.Contents(sessitem) & "<BR>")
End If
End If
Next
%>
Session StaticObjects Collection
This is preliminary documentation for IIS 5.0 and is subject to change.
The StaticObjects collection contains all of the objects created with the <OBJECT> tag within the
scope of the session object. The collection can be used to determine the value of a specific property for
an object, or to iterate through the collection and retrieve all properties for all objects.
Syntax
Session.StaticObjects( Key )
Parameters
Key
The property to retrieve.
Remarks
You can use an iterating control structure to loop through the keys of the StaticObjects collection. This
is demonstrated in the following example.
<%
Dim objProp
For Each objProp in Session.StaticObjects
If IsObject(Session.StaticObjects(objProp)) Then
Response.write(objProp & " : Session object cannot be displayed."&_
"<BR>")
Else
Response.write(objprop & " : " & Session.StaticObjects(objprop) &_
"<BR>")
End if
Next
%>
Active Server Pages Guide Page 560 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Session Properties
This is preliminary documentation for IIS 5.0 and is subject to change.
The Session object has the following properties.
? CodePage
? LCID
? SessionID
? Timeout
CodePage
This is preliminary documentation for IIS 5.0 and is subject to change.
The CodePage property determines the code page that will be used to display dynamic content.
Syntax
Session.CodePage(=Codepage)
Parameters
Codepage
An unsigned integer that represents a valid code page for the system that is running the scripting
engine.
Remarks
A code page is a character set that can include numbers, punctuation marks, and other glyphs. Different
languages and locales may use different code pages. For example, ANSI code page 1252 is used for
American English and most European languages; OEM code page 932 is used for Japanese Kanji.
A code page can be represented in a table as a mapping of characters to single-byte values or multibyte
values. Many code pages share the ASCII character set for characters in the range 0x00 0x7F.
Applies To
Session Object
LCID
This is preliminary documentation for IIS 5.0 and is subject to change.
The LCID property determines the location identifier that will be used to display dynamic content.
Active Server Pages Guide Page 561 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Syntax
Session.LCID(=LCID)
Parameters
LCID
A valid locale identifier.
Remarks
An LCID specifies the locale identifier, which is a standard international abbreviation that uniquely
identifies one of the system-defined locales. If an LCID has been set using the @LCID directive
Session.LCID will override the value set by the directive.
Example
The following example demonstrates setting the locale to British English and using the VBScript
FormatCurrency method to display the value 125 as currency with the symbol:
<%
Session.LCID = 2057
Dim curNumb
curNumb = FormatCurrency(125)
Response.Write (curNumb)
%>
Applies To
Session Object
For more information, see Accommodating International Clients and Locale Identifiers.
SessionID
This is preliminary documentation for IIS 5.0 and is subject to change.
The SessionID property returns the session identifier, a unique identifier that is generated by the server
when the session is created. The session ID is returned as a LONG data type.
Syntax
Session.SessionID
Active Server Pages Guide Page 562 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
You should not use the SessionID property to generate primary key values for a database application.
This is because if the Web server is restarted, some SessionID values may be the same as those
generated before the server was stopped. Instead, you should use an auto-increment column data type,
such as IDENTITY with Microsoft
Access.
Applies To
Session Object
Timeout
This is preliminary documentation for IIS 5.0 and is subject to change.
The Timeout property specifies the timeout period assigned to the Session object for this application, in
minutes. If the user does not refresh or request a page within the timeout period, the session ends.
Syntax
Session.Timeout [ = nMinutes]
Parameters
nMinutes
Specifies the number of minutes that a session can remain idle before the server terminates it
automatically. The default is 10 minutes.
Applies To
Session Object
See Also
Abandon
Session Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The Session object exposes the following methods.
? Abandon
? Contents.Remove
Active Server Pages Guide Page 563 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? Content.RemoveAll
Abandon
This is preliminary documentation for IIS 5.0 and is subject to change.
The Abandon method destroys all the objects stored in a Session object and releases their resources. If
you do not call the Abandon method explicitly, the server destroys these objects when the session times
out.
Syntax
Session.Abandon
Remarks
When the Abandon method is called, the current Session object is queued for deletion, but is not
actually deleted until all of the script commands on the current page have been processed. This means
that you can access variables stored in the Session object on the same page as the call to Abandon, but
not in any subsequent Web pages.
For example, in the following script, the third line prints the value Mary. This is because the Session
object is not destroyed until the server has finished processing the script.
<%
Session.Abandon
Session("MyName") = "Mary"
Reponse.Write(Session("MyName"))
%>
If you access the variable MyName on a subsequent Web page, it is empty. This is because MyName was
destroyed with previous Session object when the page containing the above example finished
processing.
The server creates a new Session object when you open a subsequent Web page after abandoning a
session. You can store variables and objects in this new Session object.
Example
The following example causes the session state to be released when the server finishes processing the
current page.
<% Session.Abandon %>
Applies To
Session Object
Active Server Pages Guide Page 564 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
Timeout
Contents.Remove
This is preliminary documentation for IIS 5.0 and is subject to change.
The Remove method deletes a specific item from the Session object's Contents collection.
Syntax
Session.Contents.Remove( Item|Index )
Parameter
Item
The name of the member to remove from the collection.
Index
The index entry for the member to remove from the collection.
Remarks
The Contents.Remove method takes either a string or an integer as an input parameter. If the input
parameter is a string, the method will search the contents collection for an item with that name and
remove it. If the input parameter is an integer, the method counts that number of items from the start of
the collection, and removes the corresponding item.
Example
The following example adds and removes a variable called myName to the Session.Contents
collection.
<%
Session("myName") = " "
Session.Collection.Remove("myName")
%>
Applies To
Session Object
See Also
Session.Contents.RemoveAll
Contents.RemoveAll
Active Server Pages Guide Page 565 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The RemoveAll method deletes all items that have been added to the Session object's Contents
collection.
Syntax
Session.Contents.RemoveAll ()
Example
The following example removes all items that have been added to the Session.contents collection:
<%Session.Contents.RemoveAll()%>
Applies To
Session Object
See Also
Session.Contents.Remove
Installable Components for ASP
This is preliminary documentation for IIS 5.0 and is subject to change.
You can create dynamic, interactive Web pages by using the server components included with Active
Server Pages (ASP) in your scripts. This reference section contains information about and examples of
these components.
Ad Rotator Creates an AdRotator object that automatically rotates
advertisements displayed on a page according to a specified
schedule.
Browser Capabilities Creates a BrowserType object that determines the capabilities,
type, and version of each browser that accesses your Web site.
Content Linking Creates a NextLink object that creates tables of contents for
Web pages, and links them together sequentially like pages in a
book.
Content Rotator Automates the rotation of HTML content strings on a Web
page.
Counters Creates a Counters object that can create, store, increment,
and retrieve any number of individual counters.
Active Server Pages Guide Page 566 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
For information on server scripting with ASP, see Developing Web Applications. For more information
on the built-in objects supplied with the ASP, see Visual Basic Object Model.
NoteThe examples in this reference use Microsoft
Visual Basic
Data Objects
(ADO).
File Access Component Provides access to file input and output.
Logging Utility Allows you to read the HTTP activity log files that IIS generates.
MyInfo Creates a MyInfo object that keeps track of personal
information, such as the site administrator's name, address, and
display choices.
Page Counter Counts and displays the number of times a Web page has been
opened.
Permission Checker Uses the password authentication protocols provided in
Microsoft
Parameters
URL
Specifies the path to the dynamic-link library (.dll) or application (.asp) file that implements
redirection. This path can be specified either fully (http://MyServer/MyDir/redirect.asp) or relative
to the virtual directory (/MyDir/redirect.asp).
numWidth
Specifies the width of the advertisement on the page, in pixels. The default is 440 pixels.
numHeight
Specifies the height of the advertisement on the page, in pixels. The default is 60 pixels.
Active Server Pages Guide Page 569 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
numBorder
Specifies the thickness of the hyperlink border around the advertisement, in pixels. The default is a
1-pixel border. Set this parameter to 0 for no border.
adURL
The location of the advertisement image file.
adHomePageURL
The location of the advertiser's home page. If the advertiser does not have a home page, put a
hyphen (-) on this line to indicate that there is no link for this ad.
Text
Alternate text that is displayed if the browser does not support graphics, or has its graphics
capabilities turned off.
impressions
A number between 0 and 10000 that indicates the relative weight of the advertisement.
For example, if a Rotator Schedule file contains three ads with impressions set to 2, 3, and 5, the
first advertisement is displayed 20 percent of the time, the second 30 percent of the time, and the
third 50 percent of the time.
Remarks
If the sum of the impressions parameters for all items exceeds 10000, an error will be generated the first
time the Rotator Schedule file is accessed by a call to the GetAdvertisement method.
Example
The following script demonstrates how you can use a rotator schedule file to display a variety of
advertisements and how to include a redirection file.
---Adrot.txt---
REDIRECT /scripts/adredir.asp
WIDTH 440
HEIGHT 60
BORDER 1
*
http://kabaweb/ads/homepage/chlogolg.gif
http://www.bytecomp.com/
Check out the ByteComp Technology Center
20
http://kabaweb/ads/homepage/gamichlg.gif
-
Sponsored by Flyteworks
20
http://kabaweb/ads/homepage/ismodemlg.gif
http:// www.proelectron.com/
28.8 internal PC modem, only $99
80
http://kabaweb/ads/homepage/spranklg.gif
http://www.clocktower.com/
The #1 Sports site on the net
10
Redirection File
Active Server Pages Guide Page 570 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
The Redirection file is a file that you create. It usually includes script to parse the query string sent by the
AdRotator object and to redirect the user to the URL associated with the advertisement that the user
clicked on.
You can also include script in the Redirection file to count the number of users that have clicked on a
particular advertisement, and save this information to a file on the server.
Example
The following example redirects the user to the advertiser's home page.
---Adredir.asp---
<% Response.Redirect(Request.QueryString("url")) %>
Ad Rotator Properties
This is preliminary documentation for IIS 5.0 and is subject to change.
The AdRotator object has the following properties:
Border
This is preliminary documentation for IIS 5.0 and is subject to change.
The Border property enables you to specify whether to display the advertisements with a surrounding
border.
Syntax
Border = size
Parameters
size
Specifies the thickness of the border that surrounds the displayed advertisement. The default is the
value set in the header of Rotator Schedule file.
Border Specifies the size of the border around the
advertisement.
Clickable Specifies whether the advertisement is a hyperlink.
TargetFrame Specifies the name of the frame in which to display
the advertisement.
Active Server Pages Guide Page 571 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Example
The following example displays the advertisements without a border.
<%
Set ad = Server.CreateObject("MSWC.AdRotator")
ad.Border = 0
%>
<%= ad.GetAdvertisement("/ads/adrot.txt") %>
See Also
Clickable, TargetFrame
Clickable
This is preliminary documentation for IIS 5.0 and is subject to change.
The Clickable property enables you to specify whether the advertisements are displayed as hyperlinks.
Syntax
Clickable = value
Parameters
value
Specifies whether the advertisement should be a hyperlink. This parameter can be one of the
following values. The default value is TRUE.
Example
The following example displays the advertisements as images only, not as hyperlinks.
<%
Set ad = Server.CreateObject("MSWC.AdRotator")
ad.Clickable = FALSE
%>
<%= ad.GetAdvertisement("/ads/adrot.txt") %>
See Also
Border, TargetFrame
Value Description
TRUE Display the advertisements as hyperlinks.
FALSE Do not display the advertisements as hyperlinks.
Active Server Pages Guide Page 572 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
TargetFrame
This is preliminary documentation for IIS 5.0 and is subject to change.
The TargetFrame property specifies the target frame into which the link should be loaded. This
property fulfills the same function as the TARGET parameter in an HTML anchor statement.
Syntax
TargetFrame = frame
Parameters
frame
Specifies the name of the frame in which to display the advertisement. This parameter can also be
one of the HTML frame-keywords, such as _TOP, _NEW, _CHILD, _SELF, _PARENT, or
_BLANK. The default value is NO FRAME.
Example
The following example displays the advertisements in the frame AdFrame.
<%
Set ad = Server.CreateObject("MSWC.AdRotator")
ad.TargetFrame = AdFrame
%>
<%= ad.GetAdvertisement("/ads/adrot.txt") %>
See Also
Border, Clickable
Ad Rotator Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The AdRotator object has the following method:
GetAdvertisement
This is preliminary documentation for IIS 5.0 and is subject to change.
GetAdvertisement Gets the specifications for the next scheduled
advertisement from the data file and formats it as
HTML.
Active Server Pages Guide Page 573 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The GetAdvertisement method retrieves the next advertisement from the Rotator Schedule file. Each
time the script is run, such as when a user opens or refreshes a page, the method retrieves the next
scheduled advertisement.
Syntax
GetAdvertisement( rotationSchedulePath )
Parameters
rotationSchedulePath
Specifies the location of the Rotator Schedule file relative to the virtual directory. For example, if
the physical path was C:\Inetpub\Wwwroot\Ads\Adrot.txt (where Wwwroot is the "/" virtual
directory) you would specify the path \Ads\Adrot.txt.
Return Values
Returns HTML that displays the advertisement in the current page.
Example
The following example gets an advertisement from the Adrot.txt file in the /Ads/ virtual directory.
<% Set NextAd = Server.CreateObject("MSWC.AdRotator") %>
<%= NextAd.GetAdvertisement("/ads/adrot.txt") %>
Browser Capabilities Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The Browser Capabilities component creates a BrowserType object that provides your scripts with a
description of the capabilities of the client's Web browser.
When a browser connects to the Web server, it automatically sends an HTTP User Agent header. This
header is an ASCII string that identifies the browser and its version number. The BrowserType object
compares the header to entries in the Browscap.ini file.
If it finds a match, the BrowserType object assumes the properties of the browser listing that matched
the User Agent header.
If the object does not find a match for the header in the Browscap.ini file, it searches for the closest
match using the * and ? wildcards. If a match can not be found using wildcards, the object will use the
default browser settings if they have been specified in the Browscap.ini file. If the object does not find a
match and default browser settings have not been specified in the Browscap.ini file, the object sets every
property to the string "UNKNOWN."
Active Server Pages Guide Page 574 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
You can add properties or new browser definitions to this component simply by updating the
Browscap.ini file.
File Names
Syntax
Set BrowserType = Server.CreateObject("MSWC.BrowserType")
Parameters
BrowserType
Specifies the name of the BrowserType object created by the call to Server.CreateObject.
Example
The following example uses the BrowserType object to display a table showing some of the capabilities
of the current browser.
<% Set bc = Server.CreateObject("MSWC.BrowserType") %>
<TABLE BORDER=1>
<TR><TD>Browser</TD><TD> <%= bc.browser %>
<TR><TD>Version</TD><TD> <%= bc.version %> </TD></TR>
<TR><TD>Frames</TD><TD>
<% if (bc.frames = TRUE) then %> TRUE
<% else %> FALSE
<% end if %> </td></TR>
<TR><TD>Tables</TD><TD>
<% if (bc.tables = TRUE) then %> TRUE
<% else %> FALSE
<% end if %> </TD></TR>
<TR><TD>BackgroundSounds</TD><TD>
<% if (bc.BackgroundSounds = TRUE) then %> TRUE
<% else %> FALSE
<% end if %> </TD></TR>
<TR><TD>VBScript</TD><TD>
<% if (bc.vbscript = TRUE) then %> TRUE
<% else %> FALSE
<% end if %> </TD></TR>
<TR><TD>JScript</TD><TD>
<% if (bc.javascript = TRUE) then %> TRUE
<% else %> FALSE
<% end if %> </TD></TR>
</TABLE>
Browscap.ini File
Browscap.dll The Browser Capabilities component.
Browscap.ini A text file that maps browser capabilities to the HTTP User Agent
header. This file must be in the same directory as Browscap.dll.
Active Server Pages Guide Page 575 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
You can declare property definitions for any number of browsers in the Browscap.ini file. You can also
set default values to use if the client's browser is not one of the listed definitions.
For each browser definition, you provide an HTTP User Agent header and the properties and values you
wish to associate with that header. For more information on the format of the HTTP User Agent header,
refer to the HTTP specification available at http://www.w3.org.
Syntax
[; comments]
[HTTPUserAgentHeader]
[parent = browserDefinition]
[property1 = value1]
...
[propertyN = valueN]
[defaultProperty1 = defaultValue1]
...
[defaultPropertyN = defaultValueN]
Internet
Explorer 5.0 definition (for example, frames=TRUE, tables=TRUE, and cookies=TRUE). It adds
platform-specific information by adding the line, platform=WinNT, and overwrites the version
information in the line, version=4.0.
;;ie 5.0
[IE 5.0]
browser=IE
Version=5.0
majorver=#5
Property Description
ActiveXControls
Specifies whether the browser supports ActiveX
controls.
Backgroundsounds Specifies whether the browser supports background sounds.
Beta Specifies whether the browser is beta software.
Browser Specifies the name of the browser.
Cdf Specifies whether the browser supports the Channel Definition
Format for Webcasting.
Cookies Specifies whether the browser supports cookies.
Frames Specifies whether the browser supports frames.
Javaapplets Specifies whether the browser supports Java applets.
Javascript Specifies whether the browser supports JScript.
Platform Specifies the platform that the browser runs on.
Tables Specifies whether the browser supports tables.
Vbscript Specifies whether the browser supports VBScript.
Version Specifies the version number of the browser.
Active Server Pages Guide Page 578 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
minorver=#0
frames=TRUE
tables=TRUE
cookies=TRUE
backgroundsounds=TRUE
vbscript=TRUE
javascript=TRUE
javaapplets=True
ActiveXControls=TRUE
Win16=False
beta=False
AK=False
SK=False
AOL=False
;;ie 5.x
[Mozilla/4.0 (compatible; MSIE 5.*; Windows NT)]
parent=IE 5.0
version=5.0
minorver=0
platform=WinNT
; Default Browser
[Default Browser Capability Settings]
browser=Default
frames=FALSE
tables=TRUE
cookies=FALSE
backgroundsounds=FALSE
vbscript=FALSE
javascript=FALSE
Retrieving Browser Capabilities from a Cookie
This is preliminary documentation for IIS 5.0 and is subject to change.
A new way of determining client capabilities was added in IIS 5.0. If the client sends a cookie describing
their capabilities as part of the request, your ASP page can create an instance of the Browser
Capabilities Component that adds the name value pairs specified by the cookie as properties.
For example, if the client sent a cookie that contained a name-value pair of userLanguage=Spanish, the
Browser Capabilities component would add a userLanguage property and set the value for this property
to Spanish.
ImportantIf the METADATAmetatag exists in a file that is requested by the client as a result of a
redirection using the Server.Transfer or Server.Execute methods, the metatag will be ignored by IIS.
METADATA metatags in the file that actually contains the redirect, however, will be processed
normally.
The following example demonstrates using a cookie to determine browser capabilities. Two files are
required:
? Sendcook.htm runs on the client and uses DHTML to determine a list of properties that have been
Active Server Pages Guide Page 579 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
set on the client.
? Checkcap.asp creates an instance of the Browser Capabilities component and retrieves the
properties from Sendcook.htm.
Sendcook.htm
<HTML XMLNS:IE>
<HEAD>
<STYLE>
IE\:clientcaps {behavior:url(#default#clientcaps)}
</STYLE>
<SCRIPT language="JavaScript">
function stopAllErrors()
{
// No errors should be presented to the user if they occur.
return true;
}
window.onerror = stopAllErrors;
function window.onload ()
{
bcString = "width= " + oClientCaps.width;
bcString += "&height= " + oClientsCaps.height;
bcString += "&bufferDepth= " + oClientCaps.bufferDepth;
bcString += "&colorDepth= " + oClientCaps.colorDepth;
bcString += "&cookies= " + oClientCaps.cookies;
bcString += "&platform= " + oClientCaps.platform;
document.cookie = "BrowsCap= " + bcString;
}
</SCRIPT>
</HEAD>
<BODY>
<IE:clientcaps ID="oClientCaps" />
</BODY>
<HTML>
Checkcap.asp
<HTML>
<BODY>
<!--METADATA TYPE="Cookie" NAME="BrowsCap" SRC="sendcook.htm"-->
<% Set myBrowsCap = Server.CreateObject("MSWC.BrowserType") %>
<%
Response.write(width= " +myBrowsCap.width + "<BR>"
Response.write(height= " +myBrowsCap.height + "<BR>"
Response.write(bufferDepth= " +myBrowsCap.bufferDepth + "<BR>"
Response.write(colorDepth= " +myBrowsCap.colorDepth + "<BR>"
Response.write(cookies= " +myBrowsCap.cookies + "<BR>"
Response.write(platform= " +myBrowsCap.platform + "<BR>"
%>
</BODY>
</HTML>
For more information on the design implications for determining browser capabilities, see Client
Capabilities.
Active Server Pages Guide Page 580 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Content Linking Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The Content Linking component creates a Nextlink object that manages a list of URLs so that you can
treat the pages in your Web site like the pages in a book. You can use the Content Linking component to
automatically generate and update tables of contents and navigational links to previous and subsequent
Web pages. This is ideal for applications such as online newspapers and forum message listings.
The Content Linking component references a Content Linking List file that contains the list of the linked
Web pages. This list is stored on the Web server.
File Names
Syntax
Set NextLink = Server.CreateObject( "MSWC.NextLink" )
Parameters
NextLink
Specifies the name of the object created by the call to Server.CreateObject.
Methods
Nextlink.dll The Content Linking component
Content Linking List A text file that contains a list of Web pages in the order in which they
should be displayed. This file must be available on a Web server
virtual path.
GetListCount Counts the number of items linked in the Content Linking List file.
GetListIndex Gets the index of the current page in the Content Linking List file.
GetNextDescription Gets the description of the next page listed in the Content Linking
List file.
GetNextURL Gets the URL of the next page listed in the Content Linking List
file.
GetNthDescription Gets the description of the Nth page listed in the Content Linking
List file.
GetNthURL Gets the URL of the Nth page listed in the Content Linking List
file.
GetPreviousDescription Gets the description line of the previous page listed in the Content
Linking List file.
Active Server Pages Guide Page 581 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Example
The following example builds a table of contents.
<OL>
<%
Set NextLink = Server.CreateObject ("MSWC.NextLink")
count = NextLink.GetListCount ("/data/nextlink.txt")
I = 1
%>
<UL>
<% Do While (I <= count) %>
<LI><A HREF=" <%= NextLink.GetNthURL ("/data/nextlink.txt", I) %> ">
<%= NextLink.GetNthDescription ("/data/nextlink.txt", I) %> </A>
<%
I = (I + 1)
Loop
%>
</UL>
</OL>
The following script adds the next-page and previous-page buttons to an HTML file.
<%
Set NextLink = Server.CreateObject ("MSWC.NextLink")
If (NextLink.GetListIndex ("/data/nextlink.txt") > 1)
Then
%>
<A HREF=" <%= NextLink.GetPreviousURL ("/data/nextlink.txt") %> ">
Previous Page</A>
<% End If %>
<A HREF=" <%= NextLink.GetNextURL ("/data/nextlink.txt") %> ">Next Page</A>
Content Linking List File
This is preliminary documentation for IIS 5.0 and is subject to change.
The Content Linking List file contains one line of text for each URL in the list. Each line ends in a carriage
return and each item on a line is separated by a TAB character.
Syntax
Web-page-URL [ text-description [ comment]]
GetPreviousURL Gets the URL of the previous pages listed in the Content Linking
List file.
Active Server Pages Guide Page 582 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Values
Web-page-URL
The virtual or relative URL of the Web page in the format filename or directory\filename.
Absolute URLs, those that start with "http:", "//", or "\\", are not supported and will not be
processed by methods such as GetNextURL and GetListIndex. When building your content
path, you should ensure that no collisions or infinite loops can occur.
text-description
A value containing text that describes Web-page-URL.
comment
Explanatory text that is not processed by the component.
Example
The following text file creates a list of URLs that can be used by the Content Linking component.
---Nextlink.TXT---
Story1.htm Highlights From the Hockey Playoffs
Story2.htm Congress Passes New Welfare Initiative
Story3.htm Cider Recipes to Warm Long Winter Nights
Story4.htm Winter Storm to bring more snow to East
Story5.htm Reducing Stress on the Job
Sain.htm Return to the table of contents
Content Linking Methods
This is preliminary documentation for IIS 5.0 and is subject to change.
The NextLink object has the following methods:
? GetListCount
? GetListIndex
? GetNextDescription
? GetNextURL
? GetNthDescription
? GetNthURL
? GetPreviousDescription
? GetPreviousURL
GetListCount
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetListCount method retrieves the total number of Web pages listed in the Content Linking List
file.
Syntax
Active Server Pages Guide Page 583 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
GetListCount( listURL )
Parameters
listURL
The location of the Content Linking List file.
Return Values
This method returns an integer.
See Also
GetListIndex
GetListIndex
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetListIndex method retrieves the index number of the current item in the Content Linking List file.
Syntax
GetListIndex( listURL )
Parameters
listURL
The location of the Content Linking List file.
Return Values
The GetListIndex method returns an integer index value specifying the current page's position on the file
list. The index number of the first item is 1. The method returns 0 if the current page is not in the Content
Linking List file.
See Also
GetListCount
GetNextDescription
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetNextDescription method retrieves the text description of the next item in the Content Linking
Active Server Pages Guide Page 584 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
List file.
Syntax
GetNextDescription( listURL )
Parameters
listURL
The location of the Content Linking List file.
Return Values
The GetNextDescription method returns an ASCII string describing the next item in the Content
Linking List file. If the current page is not found in the list file, GetNextDescription returns the string
description of the last page on the list.
See Also
GetNextURL, GetPreviousDescription, GetNthDescription
GetNextURL
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetNextURL method retrieves the URL of the next item in the Content Linking List file.
Syntax
GetNextURL( listURL )
Parameters
listURL
The location of the Content Linking List file.
Return Values
This method returns the URL of the next page specified in the Content Linking List file. If the current
page is not specified in the Content Linking List file, GetNextURL returns the URL of the last page on
the list.
Example
The following example uses the GetNextURL method to embed a link to the next page in the Content
Linking List file. The advantage of using GetNextURL is that when you change the order or number of
the content pages, you only have to update the list in Content Linking List file and do not need to update
the navigational links on each page.
Active Server Pages Guide Page 585 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<% Set NextLink = Server.CreateObject ("MSWC.NextLink") %>
<A HREF="<%= NextLink.GetNextURL ("/data/nextlink.txt") %>">Next Page </A>
See Also
GetPreviousURL, GetNthURL, GetNextDescription
GetNthDescription
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetNthDescription method retrieves a text description of the Nth item in the Content Linking List
file.
Syntax
GetNthDescription( listURL, i )
Parameters
listURL
The location of the Content Linking List file.
i
The index number of an item in the Content Linking List file.
Return Values
This method returns a string.
See Also
GetNextDescription, GetPreviousDescription, GetNthURL
GetNthURL
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetNthURL method returns the URL of the Nth item in the Content Linking List file.
Syntax
GetNthURL( listURL, i )
Parameters
Active Server Pages Guide Page 586 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
listURL
The location of the Content Linking List file.
i
The index number of an item in the Content Linking List file.
Return Values
This method returns a string.
See Also
GetNextURL, GetPreviousURL, GetNthDescription
GetPreviousDescription
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetPreviousDescription method retrieves a text description of the previous item in the Content
Linking List file.
Syntax
GetPreviousDescription( listURL )
Parameters
listURL
The location of the Content Linking List file.
Return Values
This method returns a string describing either the previous item in the Content Linking List file or, if the
current page is not in the file, the first item on the list.
See Also
GetNextDescription, GetNthDescription, GetPreviousURL
GetPreviousURL
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetPreviousURL method returns the URL of the previous item in the Content Linking List file.
Syntax
GetPreviousURL( listURL )
Active Server Pages Guide Page 587 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Parameters
listURL
The location of the Content Linking List file.
Return Values
This method returns a string containing the URL of the previous item in the Content Linking List file. If the
current page is not specified in the Content Linking List file, GetPreviousURL returns the URL of the
first page in the file.
See Also
GetNextURL, GetNthURL, GetPreviousDescription
Content Rotator Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The Content Rotator component creates a ContentRotator object that automatically rotates HTML
content strings on a Web page. Each time a user requests the Web page, the object displays a new
HTML content string based upon information that you specify in a Content Schedule File.
Because the content strings can contain HTML tags, you can display any type of content that HTML can
represent: text, images, or hyperlinks. For example, you can use this component to rotate through a list of
daily quotations or hyperlinks, or to change text and background colors each time the Web page is
opened.
The following files are used by the Content Rotator component:
Syntax
Set oVar = Server.CreateObject( "MSWC.ContentRotator" )
Parameters
oVar
File Name Description
Controt.dll The Content Rotator component.
Content Schedule File A text file that contains the display schedule and
file information for Web content. This file must
be available on a Web server virtual path.
Active Server Pages Guide Page 588 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Specifies the name of the ContentRotator object created by the call to Server.CreateObject.
Methods
Remarks
Because the ContentRotator object uses a random generator to select which of the weighted content
strings is displayed, a string may be repeated. This is most likely to occur if there are few entries in the
Content Schedule file, or if one entry is weighted much higher than the others.
Example
The following example displays a different tip of the day each time a user views the Web page.
<%
Set Tip = Server.CreateObject("MSWC.ContentRotator")
Tip.ChooseContent("/tips/tiprot.txt")
%>
Content Schedule File
This is preliminary documentation for IIS 5.0 and is subject to change.
The Content Schedule file contains information that the ContentRotator object uses to manage and
display the specified content.
In this file you include any number of HTML content string entries. Each entry consists of two parts: a
line that begins with double percentage signs (%%) and contains both the relative weight and any
comments, and a second part that contains the HTML content string itself.
Syntax
%% [#Weight] [//Comments]
ContentString
Parameters
Weight
This optional parameter specifies a number between 0 and 10000 that indicates the relative weight
of the HTML content string. The probability of a particular content string being displayed by the
ContentRotator object can be expressed as the Weight of that content string divided by the sum
of Weight values for all entries in the Content Schedule file.
ChooseContent Retrieves and displays a content string.
GetAllContent Retrieves and displays all the content strings in the
Content Schedule file.
Active Server Pages Guide Page 589 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
For example, if a Content Schedule file contained three content strings with respective weights of
1, 3, and 4, the Content Rotator displays the first content string one-eighth of the time, the second
string three-eighths of the time, and the third string half of the time.
A Weight of 0 will cause a content entry to be ignored.
If Weight is not specified, the default value is 1.
If the sum of all weight values exceeds 10000, an error will be generated when the schedule file is
accessed by a call to either the GetAllContent or ChooseContent methods.
Comments
This optional parameter contains comments about the entry. These comments are for development
use only and are not displayed to the user. If you require more than one line of comments, you
must start each additional comment line with a line delimiter (%%) followed by a comment
delimiter (//).
ContentString
The HTML content that the ContentRotator object displays. For example, you can present a
line of text, an image, or a sound.
ContentString may include one or more lines. The ContentRotator object treats everything
between blocks of double percent signs (%%) as a single HTML content string.
Example
The following is an example of a Content Schedule file. Note that because the content strings can contain
HTML tags, you can display any type of content that can be represented with HTML, including text,
images, and hyperlinks.
-------------Content.txt--------------------
%% // Because no value is set for Weight, the default value is 1.
Don't run with scissors.
%% #2 // Content can be more that one line long.
%% // Additional line of comments.
%% // Yet another line of comments.
<FONT FACE="ARIAL,HELVETICA" SIZE="2">
Let a
<H1>smile</H1>
be your umbrella.
</FONT>
%% #3 // This is our favorite image, so show it most often.
<IMG SRC="/images/happy.gif">
%%
Here's the <A HREF="secret.asp">secret link.</A>
ChooseContent
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 590 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The ChooseContent method retrieves an HTML content string from the Content Schedule file and
displays it on the current page. The method retrieves a new content string each time the script is run, such
as when a user opens or reloads a page.
Syntax
ChooseContent( content-schedule-path )
Parameters
content-schedule-path
Specifies the location of the Content Schedule file.
This parameter can be specified either as a relative or virtual path. For example, if the Content
Schedule file, Content.txt, and the .asp file that called ChooseContent both resided in the
directory /MyApp/Tips/, where MyApp is a virtual directory on the server, then either the full
virtual path (/MyApp/Tips/Content.txt) or the relative path (Content.txt) could be specified for
content-schedule-path.
The ContentRotator object calls the Server.MapPath method to map the specified path to a
physical directory. For more information, see the Server Object reference pages.
Return Value
Returns an HTML content string from the Content Schedule file.
Remarks
Because the ContentRotator object uses a random generator to select which of the weighted content
strings is displayed, a string may be repeated. This is most likely to occur if there are few entries in the
Content Schedule file, or if one entry is weighted much higher than the others.
Example
The following example gets a new tip from the content.txt file in the /Tips/ virtual directory.
<%
Set NextTip = Server.CreateObject("MSWC.ContentRotator")
NextTip.ChooseContent("/Tips/Content.txt")
%>
GetAllContent
This is preliminary documentation for IIS 5.0 and is subject to change.
The GetAllContent method retrieves all of the HTML content strings from the Content Schedule file
and writes them directly to the Web page as a list with an <HR> tag after each entry.
Active Server Pages Guide Page 591 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This method is typically used during authoring, to proofread the Content Schedule file.
Syntax
GetAllContent( content-schedule-path )
Parameters
content-schedule-path
Specifies the location of the Content Schedule file.
This parameter can be specified either as a relative or virtual path. For example, if the Content
Schedule file, content.txt, and the .asp file that called GetAllContent both resided in the
directory /MyApp/Tips/, where MyApp is a virtual root on the server, then either the full virtual
path (/MyApp/Tips/content.txt) or the relative path (content.txt) could be specified for content-
schedule-path.
The ContentRotator object calls the Server.MapPath method to map the specified path to a
physical directory. For more information, see the Server Object Reference pages.
Return Values
None.
Remarks
The Content Rotator component uses the Response.Write method to write output directly to the .asp
page that called the GetAllContent method. For more information, see the Response Object reference
page.
Example
The following example uses the GetAllContent method to display all of the entries in the Content
Schedule file.
<H1>Tips Stored in the Content Schedule File:</H1>
<%
Set Tips = Server.CreateObject("MSWC.ContentRotator")
Tips.GetAllContent("/Tips/Content.txt")
%>
The preceding example produces HTML output such as the following:
<H1>Tips Stored in the Content Schedule File:</H1>
<HR>
Don't run with scissors.
<HR>
<FONT FACE="ARIAL,HELVETICA" SIZE="2">
Let a
Active Server Pages Guide Page 592 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<H1>smile</H1>
be your umbrella.
</FONT>
<HR>
<IMG SRC="/images/happy.gif">
<HR>
Here's the <A HREF="secret.asp">secret link.</A>
<HR>
Counters Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The Counter component creates a Counters object that can create, store, increment, and retrieve any
number of individual counters.
A counter is a persistent value that contains an integer. You can manipulate a counter with the Get,
Increment, Set, and Remove methods of the Counters object. Once you create the counter, it
persists until you remove it.
Counters do not automatically increment on an event like a page hit. You must manually set or increment
counters using the Set and Increment methods.
Counters are not limited in scope. Once you create a counter, any page on your site can retrieve or
manipulate its value. For example, if you increment and display a counter named hits in a page called
Page1.asp, and you increment hits in another page called Page2.asp, both pages will increment the same
counter. If you hit Page1.asp, and increment hits to 34, hitting Page2.asp will increment hits to 35. The
next time you hit Page1.asp, hits will increment to 36.
All counters are stored in a single text file, Counters.txt, which is located in the same directory as the
ounters.dll file.
Syntax
Create the Counters object one time on your server by adding the following to the Global.asa file:
<OBJECT
RUNAT=Server
SCOPE=Application
ID=Counter
PROGID="MSWC.Counters">
File Name Description
Counters.dll The Counters component.
Counters.txt The file that stores all individual counters on a site. Counters.txt is a UTF8-
encoded file. You can have any Unicode characters in a counter name.
Active Server Pages Guide Page 593 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
</OBJECT>
Remarks
Only create one Counters object in your site. This single Counters object can create any number of
individual counters.
NoteFor Internet Information Services on Windows
Parameters
CounterName
A string containing the name of the counter.
Active Server Pages Guide Page 595 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Example
Increment the value of a counter with <% Counters.Increment(CounterName) %>. Increment and
display the value of a counter with <%= Counters.Increment(CounterName) %>.
To retrieve the value of a counter, use Counters.Get. To set a counter to a specific value, use
Counters.Set.
The following code implements a one-line page-hit counter.
<P>There have been <%= Counters.Increment("hits") %> visits to this Web page. </P>
In this example, Counters.Increment increases the counter by one each time the client requests the
page from the server.
See Also
Get, Remove, Set
Remove
This is preliminary documentation for IIS 5.0 and is subject to change.
The Remove method takes the name of a counter, removes the counter from the Counters object, and
deletes the counter from the Counters.txt file.
Syntax
Counters.Remove( CounterName )
Parameters
CounterName
A string containing the name of the counter.
Example
The following code removes the counter hitscounter from the ounters.txt file.
<% Counters.Remove(hitscounter) %>
See Also
Get, Increment, Set
Active Server Pages Guide Page 596 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Set
This is preliminary documentation for IIS 5.0 and is subject to change.
The Set method takes the name of a counter and an integer, sets the counter to the value of the integer,
and returns the new value. If the counter doesn't exist, Counters.Set creates it and sets it to the value of
the integer.
To retrieve the value of a counter, use Counters.Get. To increment a counter by 1, use
Counters.Increment.
Syntax
Counters.Set(CounterName, int)
Parameters
CounterName
A string containing the name of the counter.
int
The new integer value for CounterName.
Example
The following code resets the hit counter pageHits to 0:
<% Counters.Set(pageHits, 0) %>
See Also
Get, Increment, Remove
Database Access Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The Database Access component uses ActiveX
Parameters
oVar
Specifies the name that can be used as a reference to the IISLog component.
Methods
Properties
AtEndOfLog Indicates whether all records have been read from
the log file.
CloseLogFiles Closes all open log files.
OpenLogFile Opens a log file for reading or writing.
ReadFilter Filters records from the log file by date and time.
ReadLogRecord Reads the next available log record from the
current log file.
WriteLogRecord Writes a log record to the current log file.
BytesReceived Indicates the bytes received.
BytesSent Indicates the bytes sent.
ClientIP Indicates the client's host name.
Cookie Indicates the client's cookie.
CustomFields Indicates an array of custom headers
DateTime Indicates the date and time in GMT.
Method Indicates the operation type.
ProtocolStatus Indicates the protocol status.
ProtocolVersion Indicates the version string.
Referer Indicates the referrer page.
ServerIP Indicates the server's IP address.
ServerName Indicates the server name.
ServerPort Indicates the port number.
ServiceName Indicates the service name.
TimeTaken Indicates the total processing time.
Active Server Pages Guide Page 599 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
The following steps are necessary to use the IIS Log component effectively:
1. Use the OpenLogFile method to specify from which log file or files the IISLog component
should read.
2. Use the ReadLogRecord to read the appropriate log records.
3. Use the IIS Log component properties to retrieve specific information from the log records.
ImportantOnly log files created by logging modules that support log file reading will be accessible
through this component. The four built-in logging modules that come with IIS support log-file reading, but
if you are using a custom or third-party logging module, you will need to enhance the logging module. See
Extending IIS Logging Capabilities for more information.
AtEndOfLog
This is preliminary documentation for IIS 5.0 and is subject to change.
This method indicates whether there are any more records available in the log file. It only returns TRUE
after an attempt to read past the end of the file.
Syntax
AtEndOfLog()
Return Values
Returns TRUE if there are no more records available in the log file for reading. Otherwise, returns
FALSE.
CloseLogFiles
This is preliminary documentation for IIS 5.0 and is subject to change.
This method causes the IISLog component to close open log files.
Syntax
URIQuery Indicates any parameters passed with the request.
URIStem Indicates the target URL.
UserAgent Indicates the user agent string.
UserName Indicates the user's name.
Win32Status Indicates the Win32 status code.
Active Server Pages Guide Page 600 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
CloseLogFiles( IOMode )
Parameters
IOMode
A Long that indicates which log file or files should be closed. It can take one of the following
values:
OpenLogFile
This is preliminary documentation for IIS 5.0 and is subject to change.
This method allows you to open a log file for reading or writing.
Syntax
OpenLogFile( FileName, [IOMode], [ServiceName], [ServiceInstance], [OutputLogFileFormat] )
Parameters
FileName
Name of the log file to open.
IOMode
Optional parameter indicating whether the log file is opened for reading or writing. This parameter
can take one of the following values:
If this parameter is omitted, the log file is opened for reading.
ServiceName
Optional parameter indicating the logging module should only return records matching this service.
ServiceInstance
Constant Value Description
ForReading 1 Closes log files that have been
opened for reading.
ForWriting 2 Closes log files that have been
opened for writing.
AllOpenFiles 32 Closes all open log files.
Constant Value Description
ForReading 1 Opens the specified log file for
reading.
ForWriting 2 Opens the specified log file for
writing.
Active Server Pages Guide Page 601 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Optional parameter indicating the logging modules should only return records matching this server
instance.
OutputLogFileFormat
Optional parameter indicating the format for log files opened for writing.
ReadFilter
This is preliminary documentation for IIS 5.0 and is subject to change.
This method allows you to read log records between a date and time range.
Syntax
ReadFilter( [startDateTime], [endDateTime] )
Parameters
startDateTime
Optional parameter indicating date and time after which log records are to be read.
endDateTime
Optional parameter indicating date and time before which log records are to be read.
ReadLogRecord
This is preliminary documentation for IIS 5.0 and is subject to change.
This method allows you to read the next available log record.
Syntax
ReadLogRecord()
See Also
AtEndOfLog
WriteLogRecord
This is preliminary documentation for IIS 5.0 and is subject to change.
This method allows you to write new log records that have been read from another IISLog object.
Syntax
Active Server Pages Guide Page 602 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
WriteLogRecord( IISLog )
Parameters
IISLog
The object indicating where the log file records are read.
BytesReceived
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables you to retrieve the number of bytes received during the operation from the current
log record.
Syntax
count = BytesReceived
Parameters
count
The number of bytes received.
BytesSent
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables you to retrieve the number of bytes sent during the operation referred to by the
current log record.
Syntax
count = BytesSent
Parameters
count
The number of bytes sent.
ClientIP
Active Server Pages Guide Page 603 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to retrieve the client's IP address for the operation referred to by the current log
record.
Syntax
var = ClientIP
Parameters
var
The client's IP address.
Cookie
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to examine the cookie.
Syntax
var = Cookie
Parameters
var
The cookie.
CustomFields
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to retrieve any extra HTTP headers that were included in the HTTP operation
referred to by the current log record. The extra headers returned are contained within a two-dimensional
array, consisting of key-value pairs.
Syntax
var = CustomFields
Parameters
Active Server Pages Guide Page 604 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
var
A two-dimensional array of variants. Each pair of variants forms a key-value pair that describes an
HTTP header.
Remarks
CustomFields can be used to retrieve any custom or special fields that were logged by IIS.
DateTime
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to retrieve the date and time from the current log record.
Syntax
var = DateTime
Parameters
var
The date and time.
Method
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables you to extract the HTTP operation type from the current log record.
Syntax
var = Method
Parameters
var
The HTTP operation type such as GET or PUT.
ProtocolStatus
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 605 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This property allows you to determine the HTTP protocol status code for the HTTP operation referred
to by the current log record.
Syntax
var = ProtocolStatus
Parameters
var
The HTTP protocol status code.
ProtocolVersion
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to retrieve the protocol version string from the current log record.
Syntax
var = ProtocolVersion
Parameters
var
The protocol version string.
Referer
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to determine the referrer URL.
Syntax
var = Referer
Parameters
var
The referrer URL.
Active Server Pages Guide Page 606 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ServerIP
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to retrieve the server's IP address for the operation referred to by the current
log record.
Syntax
var = ServerIP
Parameters
var
The server's IP address.
ServerName
This is preliminary documentation for IIS 5.0 and is subject to change.
This property permits you to retrieve the name of the computer for the operation referred to by the
current log record.
Syntax
var = ServerName
Parameters
var
The computer's name.
ServerPort
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to retrieve the port number that was used in the operation referred to by the
current log record.
Syntax
var = ServerPort
Parameters
var
The service name and server instance (such as "W3SVC1000" or "MSFTPSVC1").
TimeTaken
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to determine the total processing time required for the operation referred to by
the current log record.
Syntax
var = TimeTaken
Parameters
var
The total time for processing.
URIQuery
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables you to extract any HTTP request parameters (also known as the query string) that
Active Server Pages Guide Page 608 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
were passed during the HTTP operation referred to by the current log record.
Syntax
var = URIQuery
Parameters
var
The HTTP request parameters.
URIStem
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to extract the target URL from the current log record.
Syntax
var = URIStem
Parameters
var
The target URL string.
UserAgent
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to examine the browser user agent string.
Syntax
var = UserAgent
Parameters
var
The user agent string.
UserName
Active Server Pages Guide Page 609 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
This property enables you to discover the user name for non-anonymous clients that participated in the
operation referred to by the current log record.
Syntax
var = UserName
Parameters
var
The client's user name.
Win32Status
This is preliminary documentation for IIS 5.0 and is subject to change.
This property allows you to determine the Win32 status code from the current log record.
Syntax
var = Win32Status
Parameters
var
The Win32 status code.
MyInfo Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The MyInfo component creates a MyInfo object that keeps track of personal information, such as the
site administrator's name, address, and display choices. Typically, the administrator types this information
directly into the Web server interface. However, you can set the values of the properties directly using a
script in an ASP page.
Each property of a MyInfo object returns a string. If a MyInfo property has no value set, the property
returns an empty string.
The MyInfo object can have properties in addition to the ones documented here. The properties listed
in the table below are implemented by Personal Web Server to keep track of information entered into
Active Server Pages Guide Page 610 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
the Personal Web Services interface. If you use MyInfo on IIS, these properties will not be
implemented.
You can create new MyInfo properties by simply assigning a string value to them. For example:
<%
MyInfo.DogName = "Snoopy"
MyInfo.DogBreed = "Beagle"
%>
creates the new properties DogName and DogBreed. These new properties are stored persistently along
with the other MyInfo properties.
Create new MyInfo properties for values that remain consistent throughout a site.
The values of MyInfo properties are stored in a single text file, Myinfo.xml. MyInfo.xml is installed to
the \winnt\system32 directory on Windows 2000, and to the root directory on Windows95 or later.
File Names
Syntax
Create a MyInfo object once in the Global.asa file by adding the following:
<OBJECT
RUNAT=Server
SCOPE=Session
ID=MyInfo
PROGID="MSWC.MyInfo">
</OBJECT>
Remarks
Only create one MyInfo object on your site.
You can create a MyInfo object with Set MyInfoObject = Server.CreateObject('MSWC.MyInfo').
NoteFor Personal Web Server for Windows
Parameters
oVar
Specifies the name of the PageCounter object created by the call to Server.CreateObject.
Registry Entries
The Page Counter adds the key MSWC.PageCounter to the registry when the object is compiled or
registered. The key is added under HKEY_CLASSES_ROOT and contains the following named values.
Methods
Example
The following example uses the PageCounter object to track the number of visitors to the page and
sends a special message to the one millionth visitor.
<%
Set MyPageCounter = Server.CreateObject("MSWC.PageCounter")
HitMe = MyPageCounter.Hits
If HitMe = 1000000 Then
%>
You are the lucky 1,000,000th Customer!!! <BR>
<% Else %>
Sorry, you are customer #<%= HitMe %> <BR>
<% End If %>
Hit Count Data file
This is preliminary documentation for IIS 5.0 and is subject to change.
Named Value Description
File_Location A string that specifies the path and filename of the Hit Count Data file. The
default filename is Hitcnt.cnt. This file is located in your Windows directory.
Save_Count A DWORD that specifies the number of hits before the hit count is saved to the
Hit Count Data file. Note that this is the total number of hits, not the number of
hits per page. The default value is 25.
Hits Displays the number of times that a specified URL has been
opened.
PageHit Increments the Hit Count.
Reset Sets the hit count for a specified page to 0.
Active Server Pages Guide Page 614 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The Hit Count Data file is a text file on the server to which the Central Management object
periodically saves the hit count data. Editing this file is not recommended; errors in the format will prevent
the PageCounter object from properly loading the hit count information.
Hits
This is preliminary documentation for IIS 5.0 and is subject to change.
The Hits method returns the number of times that a specified Web page has been opened.
Syntax
Object.Hits( [pathInfo] )
Parameters
pathInfo
Optional parameter that specifies the PATH_INFO of the Web page using the
format /virtualdirectoryname/filename.asp. If this parameter is not specified, the hit count for
the current page is displayed.
Return Values
A LONG indicating the number of times that the specified Web page has been opened.
Examples
The following example uses the Hits method to display the number of times that the current Web page
has been opened.
<% Set MyPageCounter = Server.CreateObject("MSWC.PageCounter") %>
This Web page has been viewed <%= MyPageCount.Hits %> times.
<P>
Page Myscript.asp has been viewed <%= MyPageCounter.Hits("/VirtualDir1/Myscript.asp") %> times.
See Also
Reset, PageHit
PageHit
This is preliminary documentation for IIS 5.0 and is subject to change.
The PageHit method increments the hit count for the current Web page.
Syntax
Active Server Pages Guide Page 615 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Object.PageHit()
Example
The following example uses the PageHit method to increment the number of times that the current Web
page has been opened.
<%
Set MyPageCounter = Server.CreateObject("MSWC.PageCounter")
MyPageCounter.PageHit
%>
This Web page has been viewed <%= MyPageCount.Hits %> times.
See Also
Reset, Hits
Reset
This is preliminary documentation for IIS 5.0 and is subject to change.
The Reset method sets the hit count for a specified Web page to 0.
Syntax
Reset([pathInfo])
Parameters
pathInfo
Optional parameter that specifies the PATH_INFO of the Web page using the
format /virtualdirectoryname/filename.asp. If this parameter is not specified, the hit count for
the current page is reset.
Examples
The following example resets the page counters for the current Web page and Mypage.asp.
<%
Set MyPageCounter = Server.CreateObject("MSWC.PageCounter")
MyPageCounter.Reset
MyPageCounter.Reset("/VirtualDir1/Mypage.asp")
%>
(The following two values should be 0) <BR>
Hits to this page = <%= MyPageCount.Hits %> <BR>
Hits to Mypage.asp = <%= MyPageCount.Hits("/VirtualDir1/Mypage.asp") <BR>
Active Server Pages Guide Page 616 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
See Also
Hits, PageHit
Permission Checker Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The Permission Checker component creates a PermissionChecker object that uses the password
authentication protocols provided in Microsoft
Parameters
oVar
Specifies the name of the PermissionChecker object created by the call to
Server.CreateObject.
Methods
Examples
The following example uses the HasAccess method to test whether the current user has access to a
specified file. Note that you can specify either a physical or virtual path.
<% Set pmck = Server.CreateObject("MSWC.PermissionChecker") %>
Physical Path Access = <%= pmck.HasAccess("c:\pages\abc\default.htm") %>
Virtual Path Access = <%= pmck.HasAccess("/abc/default.htm") %>
Remarks
IIS supports the following three types of password authentication in any combination:
HasAccess Determines whether the user has permissions to
access a specified file.
Active Server Pages Guide Page 617 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? Anonymous
? Basic
? Integrated Windows authentication
When Anonymous authentication is enabled, all users are initially logged on under the IIS anonymous
user account. Because anonymous users all share the same account, the Permissions Checker
component cannot authenticate individual users when anonymous access is allowed.
For applications where all users have individual accounts, such as intranet-only Web sites, it is
recommended that you disable anonymous authentication so that the Permissions Checker component
can authenticate individual users.
For applications where some pages must be available to anonymous users and other pages need to be
secure, such as mixed Internet and intranet Web sites, you should enable anonymous authentication and
at least one other password authentication method, either integrated Windows authentication or Basic.
Then if you deny anonymous access to a specific page, the server will attempt to authenticate the user by
using either integrated Windows authentication or Basic password authentication.
You can use either of the following two methods to deny anonymous access to a specific page.
? Set the Access Control List for the ASP-based file to exclude the anonymous user account.
? In the ASP script, check for the anonymous user account (if the LOGON_USER server variable
is empty) and set Response.Status to the 401 Unauthorized error message. This will cause
IIS to attempt to identify the user by using NTLM or Basic authentication.
This is illustrated in the following example.
<%
If Request("LOGON_USER") = "" Then
Response.Status = "401 Unauthorized"
End if
%>
If all the files in your application must be available to anonymous users, the Permission Checker
component will not able to distinguish individual user accounts. You can still use it, however, to ensure
that the specified Web page exists and test whether the anonymous user account has access permissions
for that page.
NoteNTLM password authentication is currently supported only by Microsoft Internet Explorer, and
may not work over a proxy server. Thus, if users connect to your site with browsers other than Internet
Explorer or through a proxy server and your application requires a non-anonymous user context, you
must also enable Basic password authentication.
HasAccess
This is preliminary documentation for IIS 5.0 and is subject to change.
The HasAccess method tests whether a user has permission to access a specified file.
Active Server Pages Guide Page 618 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Syntax
HasAccess( FilePath )
Parameters
FilePath
A string that specifies the path and name of the file; this can be either a physical or virtual path.
Return Values
Returns a BOOLEAN value that indicates whether the Web user has access to the specified file. If the
file does not exist, the PermissionChecker object returns False.
Examples
The following example uses the PermissionChecker object to test whether the Web user has access to
the file C:\pages\private\default.htm. If the user has access, the script creates a hyperlink to that file;
otherwise it writes a message. This example uses a virtual path.
<%
Set pmck = Server.CreateObject("MSWC.PermissionChecker")
UserHasAccess = pmck.HasAccess("/private/default.htm")
If UserHasAccess
%>
<A HREF="/private/default.htm">Go to the Clubhouse!</A>
<% Else %>
Sorry, you are not a member.
<% End If %>
The following example repeats the preceding one but uses a physical path to determine the users
permissions.
<%
Set pmck = Server.CreateObject("MSWC.PermissionChecker")
UserHasAccess = pmck.HasAccess("c:\pages\private\default.htm")
If UserHasAccess
%>
<A HREF="/private/default.htm">Go to the Clubhouse!</A>
<% Else %>
Sorry, you are not a member.
<% End If %>
Status Component
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 619 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The Status component creates a Status object that has properties that contain server status information.
Currently this server status is only available on Personal Web Server for Macintosh.
File Names
Syntax
Set Status = Server.CreateObject( "MSWC.Status" )
Parameters
Status
Specifies the name of the Status object created by the call to Server.CreateObject.
Remarks
Currently, the Status object only returns server status information for Personal Web Server for
Macintosh. For all Windows platforms, the properties of the Status object currently all return the string
"unavailable."
The only time you may need to include a Status object is when you are running ASP scripts that were
developed on Macintosh and use Status properties.
NoteThe following table describes the Status properties as they are implemented on Macintosh.
Properties
Status.dll The Status component.
VisitorsSinceStart The number of unique visitors (IP addresses or domain
names) since the server started up.
RequestsSinceStart The number of requests since the server started up.
ActiveHTTPSessions The current number of HTTP connections.
HighHTTPSessions The highest number of concurrent HTTP connections since
the server started up.
ServerVersion The Personal Web Server version string.
StartTime The time the server started up.
StartDate The date the server started up.
FreeMem The amount of unused memory available to the server.
FreeLowMem The lowest value for the amount of unused memory available
to the server since it started up.
VisitorsToday Number of unique visitors (IP addresses or domain names)
since midnight.
Active Server Pages Guide Page 620 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Tools Component
This is preliminary documentation for IIS 5.0 and is subject to change.
The Tools component creates a Tools object that provides utilities that enable you to easily add
sophisticated functionality to your Web pages.
File Names
Syntax
Set Tools = Server.CreateObject("MSWC.Tools")
Parameters
URL
A string that specifies the relative URL of the file you are checking.
Remarks
FileExists only checks the existence of files published on your site. Therefore, it takes a relative URL
rather than an absolute URL.
Example
The following example demonstrates using the FileExists property to create a link if a particular file is
present.
FileExists Checks for the existence of a file.
Owner Checks if the current user is the site owner.
PluginExists Checks the existence of a server plug-in (on Macintosh only).
ProcessForm Processes an HTML form.
Random Generates a random integer.
Active Server Pages Guide Page 622 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%If Tools.FileExists("ie_animated.gif") then %>
<p> <a href="http://www.microsoft.Com/ie/"><img src="ie_animated.gif"></a>
<% End If %>
See Also
ProcessForm, Random
Owner
This is preliminary documentation for IIS 5.0 and is subject to change.
The Owner method checks whether the current user is the site administrator. It returns -1 if the name
and password submitted in the request header matches the Administrator name and password set in the
Personal Web Services interface. It returns 0 if there is not a match.
Syntax
Tools.Owner
Remarks
Currently, Owner only works properly on Personal Web Server for Macintosh.
See Also
FileExists, ProcessForm, Random
PluginExists
This is preliminary documentation for IIS 5.0 and is subject to change.
The PluginExists method checks whether the specified Macintosh server plug-in exists. It returns -1 if
the specified Macintosh server plug-in name is currently registered. It returns 0 if the plug-in is not
registered.
Syntax
Tools.PluginExists(PluginName)
Parameters
PluginName
A string that specifies the name of the server plug-in.
Active Server Pages Guide Page 623 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Remarks
Server plug-ins are only used on Macintosh. For IIS and Personal Web Server for Windows95 or later,
PluginExists always returns 0.
See Also
FileExists, ProcessForm, Random
ProcessForm
This is preliminary documentation for IIS 5.0 and is subject to change.
The ProcessForm method processes the contents of a form that has been submitted by a visitor to the
Web site.
Syntax
Tools.ProcessForm(OutputFileURL, TemplateURL, [InsertionPoint])
Parameters
OutputFileURL
A string containing the relative URL of the file to which the processed data is written.
TemplateURL
A string containing the relative URL of the file that contains the template, or instructions, for
processing the data.
InsertionPoint
An optional parameter indicating where in the output file to insert the process data. This parameter
has not been implemented. If you include a value for this parameter it will be ignored.
Remarks
The template files can contain ASP scripts. A script between <% and %> delimiters is treated just like
other text in the template and copied into the output file. If the output file is an ASP document, the script
will run when the output file is accessed. Scripts in template files can also be put between special <%%
and %%> delimiters which cause the script to execute while Tools.ProcessForm is executing. Since
these scripts are executed before the template data is saved in the output file, the results get saved in the
output file, usually as standard text.
If the specified output file does not exist, the server creates it.
If the InsertionPoint parameter does not exist, Tools.ProcessForm replaces the entire output file. If the
InsertionPoint parameter exists, and does not begin with an asterisk (*), Tools.ProcessForm finds the
InsertionPoint string in the output file and inserts the data immediately after it. If the InsertionPoint
string begins with an asterisk (*), Tools.ProcessForm finds the InsertionPoint string in the output file
and inserts the data immediately before it. If the InsertionPoint string exists, but is not found in the
output file, the data is appended to the end of the file.
Active Server Pages Guide Page 624 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Example
The following code demonstrates calling an .asp file to process a form.
<%
Tools.processform("/$Received Messages/default.asp","MessageInsert.process","<SPAN>*")
%>
See Also
FileExists, Random
Random
This is preliminary documentation for IIS 5.0 and is subject to change.
The Random method returns an integer between 32768 and 32767.
Syntax
Tools.random
Remarks
This method is similar to the Rnd function but returns an integer.
To get a positive random integer, use the Abs function.
To get a random integer below a specific value, use the Mod function.
Example
<% = Tools.Random %> will display a random integer between 32768 to 32767. For example,
<% = ( Abs( Tools.Random ) ) %> will display a positive random integer. For example, 23054.
<% = ( Abs( Tools.Random ) ) Mod 100 %> will display a random integer between 0 and 99. For example, 63.
See Also
FileExists, ProcessForm
Script Reference
This is preliminary documentation for IIS 5.0 and is subject to change.
This section contains reference information for building ASP pages. The following topics are included:
Active Server Pages Guide Page 625 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
? JScript Reference
? VBScript Reference
? @ Directives Reference
? Global.asa Reference
JScript Reference
This is preliminary documentation for IIS 5.0 and is subject to change.
You can read the JScript Reference at http://msdn.microsoft.com/scripting/.
VBScript Reference
This is preliminary documentation for IIS 5.0 and is subject to change.
You can read the VBScript Reference at http://msdn.microsoft.com/scripting.
@ Directives Reference
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use @ processing directives in your scripts to send information to IIS about how to process
an .asp file. For example, the following script uses the @LANGUAGE processing directive to set the
scripting language to VBScript.
<%@LANGUAGE=VBScript
Dim myvar
Application("myvar") = This is my var
Response.Write(myvar)
%>
The following five @ directives are supported by Active Server Pages (ASP) in IIS5.0.
? @CODEPAGE
? @ENABLESESSIONSTATE
? @LANGUAGE
? @LCID
? @TRANSACTION
@CODEPAGE
Active Server Pages Guide Page 626 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the @CODEPAGE directive to set the code page to be used for the .asp file. A code page
is a character set, which can include numbers, punctuation marks, and other glyphs. Different languages
and locales may use different code pages. For example, ANSI code page 1252 is used for American
English and most European languages; OEM code page 932 is used for Japanese Kanji.
A code page can be represented in a table as a mapping of characters to single-byte values or multibyte
values. Many code pages share the ASCII character set for characters in the range 0x000x7F.
You can override the code page that has been set by the @CODEPAGE directive with the
Session.CodePage property. Doing so, however, only applies to script running within the scope of the
session.
Syntax
<%@ CODEPAGE = codepage%>
Parameters
codepage
An unsigned integer that represents a valid code page for the system that is running the ASP
scripting engine.
See Also
Session.CodePage
@ENABLESESSIONSTATE
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the @ENABLESESSIONSTATE directive to turn off session tracking for a page. Session
tracking maintains information about a set of requests that are issued by a single client. If your page does
not rely on session information, turning off session tracking may decrease the time it takes for IIS to
process the script.
Syntax
<%@ ENABLESESSIONSSTATE = True|False %>
Remarks
For more information about session tracking, see Managing Sessions.
Active Server Pages Guide Page 627 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
@LANGUAGE
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the @LANGUAGE directive to set the language that will be used to interpret the
commands in a script. You can set your scripting language to any scripting engine that has been installed
in IIS. The default scripting language is VBScript, so if you do not include a @LANGUAGE directive in
your script, the script will be interpreted by the VBScript engine.
Syntax
<%@ LANGUAGE = scriptengine %>
Parameters
Scriptengine
The script engine that should compile the script. IIS ships with two script engines, VBScript and
JScript.
Remarks
You can change the default scripting language with the IIS Admin Objects AspScriptLanguage property.
You can apply this property to a Web Service, Web Server, Virtual Directory or Web Directory. For
more information, see Using IIS Admin Objects.
@LCID
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the @LCID directive to set the locale identifier (LCID) for a script. The LCID is a
DWORD containing the language identifier in the lower word and a reserved value in the upper word.
The identifier supplied in an LCID is a standard international numeric abbreviation. This LCID has the
components necessary to uniquely identify one of the installed system-defined locales. There are two
predefined LCID values. LOCALE_SYSTEM_DEFAULT is the system default locale, and
LOCALE_USER_DEFAULT is the current user's locale.
Syntax
<%@ LCID = localeidentifier %>
Parameters
localeidentifier
A valid locale identifier.
See Also
Active Server Pages Guide Page 628 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Session.LCID, Accommodating International Clients, Locales
@TRANSACTION
This is preliminary documentation for IIS 5.0 and is subject to change.
You can use the @TRANSACTION directive to indicate that the script should be treated as a
transaction. If a script is treated as a transaction, Component Services will create a transaction to
coordinate the updating of resources.
Syntax
<%@ TRANSACTION = value %>
Parameters
Value
A string that indicates the type of transaction support. Possible values are:
Remarks
If a script contains the @TRANSACTION directive, it must be the very first line in the .asp file,
otherwise an error is generated. You must add the directive to each page that should be run under a
transaction. The current transaction ends when the script finishes processing.
If the script containing the @TRANSACTION directive has been called by either the Server.Transfer
or Server.Execute method, and the value is specified as Required the script will continue the transaction
of the calling asp if the calling asp was transacted. If the calling asp was not transacted, the called asp will
create a new transaction.
For example, the following two scripts would be considered one transaction.
ASP
<%@ TRANSACTION=Required %>
<%
Server.Transfer("/asp/asp2.asp")
%>
ASP2
<%@ TRANSACTION=Required%>
Value Meaning
Required The script will initiate a transaction
Requires_New The script will initiate a transaction
Supported The script will not initiate a transaction
Not_Supported The script will not initiate a transaction
Active Server Pages Guide Page 629 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<%
Server.CreateObject("Mytransactedcomponent.Closeout")
%>
See Also
ObjectContext
Global.asa Reference
This is preliminary documentation for IIS 5.0 and is subject to change.
The Global.asa file is an optional file in which you can specify event scripts and declare objects that have
session or application scope. It is not a content file displayed to the users; instead it stores event
information and objects used globally by the application. This file must be named Global.asa and must be
stored in the root directory of the application. An application can only have one Global.asa file.
Global.asa files can contain only the following:
? Application Events
? Session Events
? <OBJECT> Declarations
? TypeLibrary Declarations
If you include script that is not enclosed by <SCRIPT> tags, or that defines an object that does not have
session or application scope, the server returns an error. The server ignores both tagged script that the
application or session events do not use, as well as any HTML in the file.
The scripts contained in the Global.asa file may be written in any supported scripting language. If multiple
event or object scripts use the same scripting language, they can be combined inside a single set of
<SCRIPT> tags.
When you save changes to the Global.asa file, the server finishes processing all of the current application
requests before it recompiles the Global.asa file. During that time, the server refuses additional requests
and returns an error message stating that the request cannot be processed while the application is being
restarted.
After all of the current user requests have been processed, the server deletes all active sessions, calling
the Session_OnEnd event for each session it deletes, closes the application, and calls the
Application_OnEnd event. The Global.asa file is then recompiled. Subsequent user requests will start
the application and create new sessions, and trigger the Application_OnStart and Session_OnStart
events.
Procedures declared in the Global.asa file can only be called from one or more of the scripts associated
with the Application_OnStart, Application_OnEnd, Session_OnStart, and Session_OnEnd events.
They are not available to the ASP pages in the ASP-based application.
To share procedures across an application, you can declare the procedures in a separate file, and then
use server-side include (SSI) statements to include the file in the ASP pages that call the procedures.
Active Server Pages Guide Page 630 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
You typically give include files an .inc extension.
NoteThe examples in this document use Microsoft
Visual Basic
. For more information on how to change the primary language, see Working with
Scripting Languages.
Application Events
This is preliminary documentation for IIS 5.0 and is subject to change.
An ASP-based application is made up of all the files in its root directory and in any subdirectories. An
application starts the first time that a user opens one of the Web pages in the application and ends when
the server shuts down. The application has two events, an Application_OnStart event and an
Application_OnEnd event.
You can specify script for these events in the Global.asa file. When the application starts, the server
looks in the Global.asa file and processes the Application_OnStart event script. When the application
ends, the server processes the Application_OnEnd event script.
Application_OnStart
This is preliminary documentation for IIS 5.0 and is subject to change.
The Application_OnStart event occurs before the first new session is created, that is, before the
Session_OnStart event. Only the Application and Server built-in objects are available. Referencing the
Session, Request, or Response objects in the Application_OnStart event script causes an error.
Syntax
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Application_OnStart
. . .
End Sub
</SCRIPT>
Parameters
ScriptLanguage
Specifies the scripting language used to write the event script. It may be any supported scripting
language, such as VBScript or JScript. If more than one event uses the same scripting language,
they can be combined under a single set of <SCRIPT> tags.
Active Server Pages Guide Page 631 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Examples
Sub Application_OnStart
Application("NumberofVisitors") = 0
End Sub
NoteThere is no need to use Application.Lock and Application.Unlock methods in the
Application_OnStart event, as this event can only be called once, by the first session that starts the
application.
See Also
Application_OnEnd, Session_OnStart
Application_OnEnd
This is preliminary documentation for IIS 5.0 and is subject to change.
The Application_OnEnd event occurs when the application quits, after the Session_OnEnd event.
Only the Application and Server built-in objects are available.
Syntax
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Application_OnEnd
. . .
End Sub
</SCRIPT>
Parameters
ScriptLanguage
Specifies the scripting language used to write the event script. It may be any supported scripting
language, such as VBScript or JScript. If more than one event uses the same scripting language,
they can be combined under a single set of <SCRIPT> tags.
Remarks
You cannot call the MapPath method in the Application_OnEnd script.
See Also
Application_OnStart, Session_OnEnd
Active Server Pages Guide Page 632 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Session Events
This is preliminary documentation for IIS 5.0 and is subject to change.
The Web server automatically creates a session when a user, who did not previously have a session,
opens a Web page in the application. The server destroys the session either when it times out or when
the server calls the Abandon method.
The session has two events, a Session_OnStart event and a Session_OnEnd event.
You can specify script for these events in the global file, Global.asa. When the session starts, the server
looks in the Global.asa file and processes the Session_OnStart event script. This script is processed
before the Web page that the user requested is processed. When the session ends, the server processes
the Session_OnEnd event script.
NoteSession tracking on by default. If you do not want to track sessions, you can disable sessions
with the @ENABLESESSIONSTATE directive.
See Also
Session Object
Session_OnStart
This is preliminary documentation for IIS 5.0 and is subject to change.
The Session_OnStart event occurs when the server creates a new session. The server processes this
script prior to executing the requested page. The Session_OnStart event is a good time for you to set
any session-wide variables, because they will be set before any pages are accessed. All the built-in
objects (Application, ObjectContext, Request, Response, Server, and Session) are available and can be
referenced in the Session_OnStart event script.
Syntax
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Session_OnStart
. . .
End Sub
</SCRIPT>
Parameters
Active Server Pages Guide Page 633 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ScriptLanguage
Specifies the scripting language used to write the event script. It may be any supported scripting
language, such as VBScript or JScript. If more than one event uses the same scripting language,
they can be combined under a single set of <SCRIPT> tags.
Example
Although the Session object persists if the Session_OnStart event contains a call to the Redirect or
End methods, the server stops processing the script in both the Global.asa file and in the file that
triggered the Session_OnStart event.
You can call the Redirect method in the Session_OnStart event, for example, to ensure that users
always start a session at a particular Web page. When the user enters the application, the server creates
a session for that user and processes the Session_OnStart event script. You can include script in this
event to check whether the page opened by the user is the starting page and, if not, direct the user to the
starting page by calling the Response.Redirect method. This is demonstrated in the following example.
<SCRIPT RUNAT=Server LANGUAGE=VBScript>
Sub Session_OnStart
'Make sure that new users start on the correct
'page of the ASP application.
'Replace the value given to startPage below
'with the virtual path to your application's
'start page.
startPage = "/MyApp/StartHere.asp"
currentPage = Request.ServerVariables("SCRIPT_NAME")
'Do a case-insensitive compare, and if they
'don't match, send the user to the start page.
If strcomp(currentPage,startPage,1) then
Response.Redirect(startPage)
End If
End Sub
</SCRIPT>
The preceding example only works for browsers that support cookies. Because a noncookie browser
does not return the SessionID cookie, the server creates a new session each time the user requests a
page. Thus for each request, the server processes the Session_OnStart script and redirects the user to
the starting page. If you use the script below, it is recommended that you put a notice on your starting
page to inform users that the site requires a cookie-enabled browser.
Remarks
You should note that any Session_OnStart event script that follows a call to the Redirect method is not
executed. For this reason, you should call the Redirect method last in your event script. This is
demonstrated in the following example.
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
'Session initialization script.
Response.Redirect "http:/server/app/StartHere.asp"
End sub
Active Server Pages Guide Page 634 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
</SCRIPT>
In the preceding example the Redirect method hides any text displayed to the client during the session-
initialization script.
See Also
Session_OnEnd, Application_OnStart
Session_OnEnd
This is preliminary documentation for IIS 5.0 and is subject to change.
The Session_OnEnd event occurs when a session is abandoned or times out. Of the server built-in
objects, only the Application, Server, and Session objects are available.
Syntax
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Session_OnEnd
. . .
End Sub
</SCRIPT>
Parameters
ScriptLanguage
Specifies the scripting language used to write the event script. It may be any supported scripting
language, such as VBScript or JScript. If more than one event uses the same scripting language,
they can be combined under a single set of <SCRIPT> tags.
Remarks
You cannot call the MapPath method in the Session_OnEnd script.
See Also
Session_OnStart, Application_OnEnd
<OBJECT> Declarations
This is preliminary documentation for IIS 5.0 and is subject to change.
You can create objects with session or application scope in the Global.asa file by using the extended
Active Server Pages Guide Page 635 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
<OBJECT> tag. This tag is self-contained and is outside of any <SCRIPT> tags.
The objects declared in the Global.asa file are not created until the server processes a script that calls
that object. This saves resources by creating only the objects that are needed.
The server does not call the OnStartPage and OnEndPage methods for objects created with application
scope. For more information on component scope see Setting Object Scope and Determining Object
Scope.
Syntax
<OBJECT RUNAT=Server SCOPE=Scope ID=Identifier
{PROGID="progID"|CLASSID="ClassID"}>
. . .
</OBJECT>
Parameters
Scope
Specifies the scope of the object. In the Global.asa file, Scope will be set to either Session or
Application.
Identifier
Specifies a name for the object instance.
ProgID
An identifier associated with a class identifier. Either ProgID or ClassID must be specified in the
<OBJECT> tag. The format for ProgID is [Vendor.]Component[.Version].
ClassID
Specifies a unique identifier for an COM class object. Either ProgID or ClassID must be
specified in the <OBJECT> tag.
Examples
The first of the following examples creates an object of session scope named MyConnection by using
the ProgID parameter. The second example uses the ClassID parameter.
<OBJECT RUNAT=Server SCOPE=Session ID=MyConnection
PROGID="ADODB.Connection">
REM Object Script
</OBJECT>
<OBJECT RUNAT=Server SCOPE=Session ID=MyConnection
CLASSID="Clsid:8AD3067A-B3FC-11CF-A560-00A0C9081C21">
REM Object Script
</OBJECT>
Remarks
The objects declared in the Global.asa file can be used by any script in the application. For example, if
Active Server Pages Guide Page 636 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
you declared the following object.
---GLOBAL.ASA---
<OBJECT RUNAT=Server SCOPE=Session ID=MyAd PROGID="MSWC.AdRotator">
</OBJECT>
You could reference the object MyAd from any page in the application:
---SOME.ASP---
<%= MyAd.GetAdvertisement("/ads/adrot.txt") %>
TypeLibrary Declarations
This is preliminary documentation for IIS 5.0 and is subject to change.
A type library is a file that contains information about objects and types supported by a COM
component. It is very common for a COM component to describe any constants that it supports in a
type library. If your Web application relies on COM objects that have declared data types in type
libraries, you can declare the type libraries in Global.asa. Doing so will make it possible to refer to the
constants declared in the type libraries from any script within the application boundary.
For more information about using constants in ASP, see Using Variables and Constants.
Syntax
<!--METADATA TYPE="TypeLib"
FILE="file"
UUID="typelibraryuuid"
VERSION="majorversionnumber.minorversionnumber"
LCID="localeid"
-->
Parameters
file
Absolute path to a type library. If this parameter and the typelibraryuuid parameter are provided,
file is used to identify the type library. Either the file parameter or the typelibraryuuid parameter
is required.
typelibraryuuid
Universally unique identifier for the type library. Either the file parameter or the typelibraryuuid
parameter is required.
majorversionnumber
Used for selecting version. If the requested version is not found, then the most recent version is
used (optional).
Active Server Pages Guide Page 637 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
minorversionnumber
Used for selecting version. If the requested version is not found, then the most recent version is
used (optional).
localeid
The locale identifier to be used for the type library. If the requested locale is not found, then the
System locale identifier will be used. (optional)
Error Values
The server can return one of the following error messages.
Remarks
It is recommended that METADATA tags appear near the top of the Global.asa file. However, these
tags can appear anywhere inside of the Global.asa file, including both inside and outside the SCRIPT
tags.
You can avoid ambiguous references to constants by adding the type library name as a prefix for the
constant. For example, ADODB.adErrItemNotFound would be less ambiguous than
adErrItemNotFound.
If you use Microsoft Visual InterDev to create your Global.asa file, the METADATA tags will include
the optional STARTSPAN and ENDSPAN keywords. These keywords are ignored by IIS.
If you do not specify a locale identifier for the type library, the default locale identifier for the system will
be used. If the system locale identifier can not be used, and you have not specified a locale identifier, the
locale identifier for the Type Library will be set to 0.
Example
MyComponent in the following example was developed with Visual Basic 5.0. MyComponent defines the
constant MyError with the following statement.
Public Const MyError = "You are not using MyComponent correctly."
The type library is contained in mycomponent.lib, which you have installed in the following directory.
C:\MyComponent
Error Description
ASP 0222 Invalid type library specification. The METADATA tag contains an
invalid type library specification.
ASP 0223 Type library not found. The METADATA tag contains a type library
specification that does not match any registry entry.
ASP 0224 Type library cannot be loaded. ASP cannot load the type library
specified in the METADATA tag.
ASP 0225 Type library cannot be wrapped. ASP cannot create a Type Library
Wrapper object from the type libraries specified in the METADATA
tag.
Active Server Pages Guide Page 638 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The following METADATA tag is included in the Global.asa file for the MyApp application.
<!--METADATA TYPE="TypeLib"
FILE="MyComponent.tlb"
-->
Any .asp file in the MyApp application can now include the following script:
<%
Dim MyVar
Set MyVar = Server.CreateObject("MyComponent.MyClass")
Currentreturn = MyVar.MyMethod
If Currentreturn = False
Response.Write(MyError)
End If
%>
ASP Samples
This is preliminary documentation for IIS 5.0 and is subject to change.
Welcome to the ASP samples. Through these clear and simple examples, this section exposes you to the
power and extensibility of Internet Information Services (IIS), one step at a time. Included are sample
ASP scripts and Windows
Visual
Basic
Access database,
and print the results. The first step is to create an instance of the Connection object, using the
Server.CreateObject method. The sample uses the Connection object instance to open the OLE DB
data provider, then uses the Connection instance again to execute a SQL SELECT command to
retrieve all the records from the Authors table. The script finishes by iterating through the returned
recordset collection and displaying the results. Afterwards, both the recordset and OLE DB data source
Active Server Pages Guide Page 652 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
connection are closed.
ImportantOLE DB must be properly configured on the server for this sample to run properly.
Location
The VBScript and JScript versions of this script are available in the IIS samples directory,
at ...\asp\database\SimpleQuery_VBScript.asp and ...\asp\database\SimpleQuery_JScript.asp.
Limit Query Results
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
In an Internet environment, it is often desirable to limit the amount of information that a database query
returns to a client browser. This example demonstrates how a script, using ASP and ADO, can limit the
number of rows returned.
Code Tour
The sample first creates an instance of the Connection object, and opens the OLE DB connection with
this object's Open method. CreateObject is used again to instantiate an empty Recordset object. The
ActiveConnection property of the new Recordset object is set to point at the open OLE DB
connection, an SQL source string is assigned, and cursor type specified. The key to limiting the results
lies with the Recordset object's PageSize property. For this example, the value is set to 10, which
indicates that ADO is to return at most 10 records. Finally, the Open method is called, and ADO
searches for the first 10 records that fulfill the SQL search string.
When ADO has returned and placed the results of the search into the Recordset object, the script loops
through the page, displaying all fields of each record in a table. The script then performs the typical
housecleaning operations, closing both the recordset and the connection.
It is important to realize that if the SQL query had returned more than 10 records, this script would not
display them. Instead, the extra records would be deposited on one or more additional, logical pages.
The property PageCount indicates how many logical pages of data were returned.
ImportantOLE DB must be properly configured on the server for this sample to run properly.
Location
The VBScript and JScript versions of this script are available in the IIS samples directory,
at ...\asp\database\LimitRows_VBScript.asp and ...\asp\database\LimitRows_JScript.asp.
Scrollable Query
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
Active Server Pages Guide Page 653 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
When you design application for an Internet environment, you will often want to limit the amount of
information that a database query returns to a client browser. This example demonstrates how a script,
using ASP and ADO, can limit the number of rows passed to the client browser in any one chunk, but
still allow the user to browse through all the results of the query.
Code Tour
The script consists of several code sections that all work together to accomplish this task. First, the
database is accessed as usual, creating a Connection object and Recordset object. The Recordset
object's PageSize property is set to 4, and the recordset is opened and populated with the query results
from the database table Authors. The first logical page of four result records are displayed in a table.
Two buttons, PgUp and PgDn, are provided so that the user can view other pages of the recordset.
If a user clicks on a button, the page is accessed again, this time using the POST method to pass some
variables to the next copy of itself. The variable PageNo is used to store what page the user is currently
viewing, while the Mv variable is used to pass the scrolling direction to the next form. If a user clicks on
PgDn, for instance, the page is accessed again, with Mv set to PgDn and PageNo set to 1. The script
would use that information to add 1 to the current page number, and AbsolutePage could then be used
to display the next page of results.
ImportantOLE DB must be properly configured on the server for this sample to run properly.
Location
The VBScript and JScript versions of this script are available in the IIS samples directory,
at ...\asp\database\MultiScrolling_VBScript.asp and ...\asp\database\MultiScrolling_JScript.asp.
Add/Delete Records
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
This sample illustrates the techniques you need to know in order to use ASP and ADO to add and delete
records from a database.
Code Tour
First, CreateObject is used to create an instance of the Connection object, which in turn is used to
open a connection to the OLE DB data provider. CreateObject is used again, this time to create an
empty Recordset object. The ActiveConnection property is set to refer to the new Connection
object.
Although the ADO Recordset object provides the AddNew method to add new records to a database,
you may be able to achieve better scalability by sending SQL INSERT commands directly to the
database engine. This sample uses the Recordset.Execute command, with the appropriate SQL
command string, to insert information for a new author.
At this point, another Recordset object instance is created and opened with another SQL command.
Active Server Pages Guide Page 654 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
The record just added is selected, then deleted by passing the SQL DELETE command directly to the
database engine. The script then terminates.
ImportantOLE DB must be properly configured on the server for this sample to run properly.
Location
The VBScript and JScript versions of this script are available in the IIS samples directory,
at ...\asp\database\AddDelete_VBScript.asp and ...\asp\database\AddDelete_JScript.asp.
Update Records
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
This example demonstrates how your application can use ADO to update existing records.
Code Tour
CreateObject is used to create an instance of the Connection object, which in turn is used to open a
connection to the OLE DB data provider. CreateObject is used again, this time to create an empty
Recordset object. The ActiveConnection property is set to refer to the new Connection object.
The new recordset is then configured. The Recordset.Execute method takes a SQL command string as
a parameter. This sample uses a SQL UPDATE command string to efficiently perform the update to the
appropriate database records.
ImportantOLE DB must be properly configured on the server for this sample to run properly.
Location
The VBScript and JScript versions of this script are available in the IIS samples directory,
at ...\asp\database\Update_VBScript.asp and ...\asp\database\Update_JScript.asp.
Executing Stored Procedures
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
Stored procedures, such as those provided by Microsoft
Visual Basic
, can
be used to automate time-consuming administrative tasks. This section provides some simple example
scripts designed to run on your local machine, written in VBScript and JScript, and executed by the
Windows Scripting Host (WSH). The samples provided here illustrate basic techniques for
accomplishing common tasks.
? Logging Module Enumerator
? Metabase Backup Utility
? Metabase Backup Restore Utility
? Web Server Creator
The general format for invoking a WSH script is either Cscript.exe ScriptName to execute the script at
the command line, or Wscript.exe ScriptName to execute the script in a window. You can also create a
batch file that will execute Cscript.exe or Wscript.exe and your script. For more information about
WSH, please refer to the Windows Scripting Host documentation.
Active Server Pages Guide Page 657 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
ImportantWSH must be locally installed to execute these sample scripts. In addition, most of these
scripts access functionality provided by IIS, and therefore require that IIS and WSH be installed locally.
Logging Module Enumerator
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
Multiple logging modules can lead to multiple problems if you aren't prepared. This sample tool illustrates
some techniques you can use to create logging management tools of your own.
This sample tool serves two separate functions. If it is invoked without command-line arguments, then it
simply lists all logging modules that currently have entries in the metabase on your server. But if an
ADsPath is given, such as IIS://LocalHost/W3SVC/3, then the tool will try to determine what is
considered the active logging module for that metabase node, and will give you information about that
logging module.
Code Tour
To list the available logging modules, the GetObject method is invoked to gain access to the
IIS://LocalHost/Logging node of the metabase. A For ... Each loop is then used to enumerate the
modules that are founded in that node.
Gathering information about a specific server's logging module is a bit more involved. Because the only
property at the server level that indicates what logging module is currently in use by the server is the
LogPluginClsId property, this value must be compared to each and every module listed at
the //LocalHost level until a match is found.
GetObject is used to gain access to the list of logging modules provided at the //LocalHost level. The
CLSID of the logging module is compared to the CLSID of each logging module provided in this main
list until a match is found. When a match is found, the script tells you all it can about the logging module; if
no match is found between the CLSIDs, the script aborts with an error.
Location
This script is available in the IIS samples directory, at ...\admin\logenum.vbs.
Metabase Backup Utility
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
The IIS metabase is a large and complicated structure, and has much vital information about your
Internet sites. So that you can easily protect that important data, backing up the metabase has been made
Active Server Pages Guide Page 658 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
into a relatively easy task. This tool demonstrates how you can create a tool that makes backing up the
metabase even easier.
Code Tour
All metabase backup functionality is provided at the IIS://LocalHost level, so this string is passed to
GetObject to get a reference to the local machine object. The Backup method is then invoked with
several parameters, including a number of flags, a location, and a version number.
The location parameter refers to a name that you give to your set of backup versions. Backup
implementation will probably change in future releases, but at the time of this writing, all backups are
stored in the same directory. Therefore, it might be helpful to think of location as the name of a series of
backup snapshots.
The backup version parameter can be explicit, or you can use one of several special values, the most
important being &HFFFFFFFF. This value, which equals -1 in VBScript, indicates that the Backup
method should assign a version number to this backup that is one higher than the highest version number
found for that location.
Location
This script is available in the IIS samples directory, at ...\admin\metaback.vbs.
Metabase Backup Restore Utility
This is preliminary documentation for IIS 5.0 and is subject to change.
Overview
If you have backed up your metabase, and then somehow corrupted the configuration on all of your
Web sites, you will need to retrieve your metabase backup. This tool is provided for just such a situation.
Code Tour
The method to restore the metabase is simply called Restore, and is accessed at the same
IIS://LocalHost node of the metabase that the Backup method was. Restore takes several parameters,
including the location string and the version number. Again, there are several constants that can be used
in place of an explicit version number. This sample uses as a default one of those constants,
&HFFFFFFFE (-2 decimal), which indicates that the server should look for, and restore from, the
highest numbered version of the specified backup location.
Location
This script is available in the IIS samples directory, at ...\admin\metabackenum.vbs.
Web Server Creator
This is preliminary documentation for IIS 5.0 and is subject to change.
Active Server Pages Guide Page 659 of 659
file://C:\WINNT\Profiles\Administrator\Local Settings\Temp\~hhB820.htm 22/11/2000
Overview
Server creation, deletion, stopping, starting, configuring: These are all tasks that can keep you very busy,
especially if you are an administrator of a large Internet or intranet Web site. This sample tool
demonstrates how you can automate many of those tasks.
Code Tour
This sample script provides a simple interface through which you can create a new Web server. Several
steps are required to accomplish this, starting with invoking GetObject on the IIS://LocalHost/W3SVC
node. The IIsWebService object's ADSI method Create is used to create a new IIsWebServer
object. The server object is then configured, and the new information written back to the metabase with
the SetInfo method.
At this point in the script, the server is not a fully functional Web site. It now has a node in the metabase,
but it is not running, nor does it have a root directory in which to store anything. To finish creating the
Web site, the tool creates an instance of the IIsWebVirtualDir ADSI object, then configures that
object to be the new root directory for the new server. SetInfo is once again called to save the
information to the metabase, and finally, if all has gone well up to this point, the server object's Start
method is invoked.
Remarks
Note that almost every major statement group in this sample has its own set of error-code checking. This
is important when creating any tool in general, but especially for tools that use the IIS metabase.
Location
This script is available in the IIS samples directory, at ...\admin\mkwebsrv.vbs.