IsapiCgiRestrictionSection Class

Configures ISAPI and Common Gateway Interface (CGI) restrictions for a Web server that runs in ISAPI mode.

Syntax

class IsapiCgiRestrictionSection : ConfigurationSectionWithCollection  

Methods

The following table lists the methods exposed by the IsapiCgiRestrictionSection class.

Name Description
Add (Inherited from ConfigurationSectionWithCollection.)
Clear (Inherited from ConfigurationSectionWithCollection.)
Get (Inherited from ConfigurationSectionWithCollection.)
GetAllowDefinition (Inherited from ConfigurationSection.)
GetAllowLocation (Inherited from ConfigurationSection.)
Remove (Inherited from ConfigurationSectionWithCollection.)
RevertToParent (Inherited from ConfigurationSection.)
SetAllowDefinition (Inherited from ConfigurationSection.)
SetAllowLocation (Inherited from ConfigurationSection.)

Properties

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.)

Subclasses

This class contains no subclasses.

Remarks

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.

Example

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  
  

Inheritance Hierarchy

ConfigurationSection

ConfigurationSectionWithCollection

IsapiCgiRestrictionSection

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF file WebAdministration.mof

See Also

ConfigurationSectionWithCollection Class
IsapiCgiRestrictionElement Class