Share via


Enabling ASP, ASP.NET, CGI, and ISAPI Extensions

IIS 6.0 installs in a highly secure state, allowing only static HTML files to be served. ASP scripts, Internet Database Connector (IDC) extensions, server-side includes, WebDAV extensions , unknown CGIs, and unknown ISAPI extensions, are listed in the Web service extension restriction list (WSERL), but they are disabled.

The WebSvcExtRestrictionList metabase property must be configured programmatically or through IIS Manager to enable any of these dynamic features, or to install and enable new CGIs and ISAPI extensions.

When configuring WebSvcExtRestrictionList programmatically, it is recommended that the ADSI or WMI providers be used instead of ABO. The ADSI and WMI methods are easier to use and do their own error checking. For a comparison of ADSI, WMI, and ABO, see Comparison of IIS Administration Features

IIS 5.1 and earlier: The WebSvcExtRestrictionList metabase property is not available. Therefore the information in this topic does not apply.

Enabling the Existing Dynamic Features of IIS

To enable dynamic features through IIS Manager:

  1. Click the local computer tree item.

  2. Click the Web Service Extensions tree item.

  3. In the right pane, click a service extension from the list and then click Allow or Prohibit.

  4. To configure a service extension, click Properties.

To enable dynamic features programmatically, use the methods of the ADSI IIsWebServer object or the WMI IIsWebServer object. The following example shows you how to use the VBScript programming language to enable ASP scripts and all ISAPI extensions. This example uses ADSI.

Dim lWebSvcExtRestrictionList 
Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC") 

' Store original value: 
lWebSvcExtRestrictionList = IIsWebServiceObj.Get("WebSvcExtRestrictionList") 

WScript.Echo "Before: WebSvcExtRestrictionList=" 
For ValueIndex = 0 To UBound(IIsWebServiceObj.WebSvcExtRestrictionList) 
  WScript.Echo IIsWebServiceObj.Get("WebSvcExtRestrictionList")(ValueIndex) 
Next 

' Enable ASP and all ISAPIs: 
IIsWebServiceObj.EnableWebServiceExtension "ASP" 
IIsWebServiceObj.EnableExtensionFile "*.exe" 
IIsWebServiceObj.SetInfo 

WScript.Echo "After: WebSvcExtRestrictionList=" 
IIsWebServiceObj.GetInfo 
For ValueIndex = 0 To UBound(IIsWebServiceObj.WebSvcExtRestrictionList) 
  WScript.Echo IIsWebServiceObj.Get("WebSvcExtRestrictionList")(ValueIndex) 
Next 

' Restore to original value: 
IIsWebServiceObj.Put "WebSvcExtRestrictionList", lWebSvcExtRestrictionList 
IIsWebServiceObj.SetInfo 

WScript.Echo "Restored: WebSvcExtRestrictionList=" 
For ValueIndex = 0 To UBound(IIsWebServiceObj.WebSvcExtRestrictionList) 
  WScript.Echo IIsWebServiceObj.Get("WebSvcExtRestrictionList")(ValueIndex) 
Next