IsapiCgiRestrictionSection Class [IIS 7 and higher]
Configures ISAPI and Common Gateway Interface (CGI) restrictions for a Web server that runs in ISAPI mode.
The following table lists the methods exposed by the IsapiCgiRestrictionSection class.
Name | Description |
|---|---|
(Inherited from ConfigurationSectionWithCollection.) | |
(Inherited from ConfigurationSectionWithCollection.) | |
(Inherited from ConfigurationSectionWithCollection.) | |
(Inherited from ConfigurationSection.) | |
(Inherited from ConfigurationSection.) | |
(Inherited from ConfigurationSectionWithCollection.) | |
(Inherited from ConfigurationSection.) | |
(Inherited from ConfigurationSection.) | |
(Inherited from ConfigurationSection.) |
The following table lists the properties exposed by the IsapiCgiRestrictionSection class.
Name | Description |
|---|---|
IsapiCgiRestriction | An array of IsapiCgiRestrictionElement values that contain ISAPI or CGI restrictions. |
Location | (Inherited from ConfigurationSection.) A key property. |
NotListedCgisAllowed | A read/write boolean value. true if CGI restrictions that are not listed are allowed; otherwise, false. The default is false. |
NotListedIsapisAllowed | A read/write boolean value. true if ISAPI restrictions that are not listed are allowed; otherwise, false. The default is false. |
Path | (Inherited from ConfigurationSection.) A key property. |
SectionInformation | (Inherited from ConfigurationSection.) |
ISAPI and CGI restrictions are request handlers that allow dynamic content to execute on a server. These restrictions are either CGI files (.exe) or ISAPI extensions (.dll). The Asp.dll and Aspnet_isapi.dll files are included by default. You can add custom ISAPI or CGI restrictions if the IIS configuration permits.
Note: |
|---|
If you are running IIS 7 in ISAPI mode, you can use ISAPI or CGI restrictions on your Web server. This feature is not available if you are running IIS 7 in integrated mode. |
The following example shows the values for the NotListedCgisAllowed, NotListedIsapisAllowed, and Path properties, and it lists the contents of the IsapiCgiRestriction array property.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
' Get the ISAPI-CGI restriction section.
oSite.GetSection "IsapiCgiRestrictionSection", oSection
' Display the non-array IsapiCgiRestrictionSection properties.
WScript.Echo "ISAPI CGI Restriction Section"
WScript.Echo "-----------------------------"
WScript.Echo "Path: " & oSection.Path
WScript.Echo "NotListedCgisAllowed: " & _
oSection.NotListedCgisAllowed
WScript.Echo "NotListedIsapisAllowed: " & _
oSection.NotListedIsapisAllowed
WScript.Echo
' Display the contents of the IsapiCgiRestriction array property.
WScript.Echo vbTab & "ISAPI CGI Restriction Elements"
WScript.Echo vbtab & "------------------------------"
For Each oIsapiCgiRestrictionElement In oSection.IsapiCgiRestriction
WScript.Echo vbtab & "GroupID: " & _
oIsapiCgiRestrictionElement.GroupID
WScript.Echo vbtab & "Description: " & _
oIsapiCgiRestrictionElement.Description
WScript.Echo vbtab & "Path: " & _
oIsapiCgiRestrictionElement.Path
WScript.Echo vbtab & "Allowed: " & _
oIsapiCgiRestrictionElement.Allowed
WScript.Echo
Next
Note: