Share via


IsapiCgiRestrictionElement Class [IIS 7 and higher]

Represents an ISAPI or Common Gateway Interface (CGI) restriction element.

Syntax

class IsapiCgiRestrictionElement : CollectionElement

Methods

This class contains no methods.

Properties

The following table lists the properties exposed by the IsapiCgiRestrictionElement class.

Name

Description

Allowed

A read/write boolean value. true if the restriction is allowed to run automatically; otherwise, false. The default is false.

Description

A read/write string value that contains a description of the restriction.

GroupId

An optional read/write string value that identifies a group to which a restriction belongs. This setting enables you to group restrictions for easier management.

Path

A required nonempty read-only string value that contains the path of the .dll or .exe file for the restriction. The key property.

Subclasses

This class contains no subclasses.

Remarks

Instances of this class are contained in the IsapiCgiRestriction array property of the IsapiCgiRestrictionSection class.

ISAPI and CGI restrictions are request handlers that enable dynamic content to execute on a server. These restrictions are either CGI files (.exe) or ISAPI extensions (.dll). By default, Asp.dll and Aspnet_isapi.dll are included. You can add custom ISAPI or CGI restrictions if the IIS configuration allows.

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 lists all of the IsapiCgiRestrictionElement instances for the default Web site.

' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = _
    GetObject("winmgmts:root\WebAdministration")

' Get the restriction section for the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "IsapiCgiRestrictionSection", oSection

' Display the path.
WScript.Echo "Path: " & oSection.Path
WScript.Echo

' Display all the ISAPI CGI restriction elements.
WScript.Echo "ISAPI CGI Restriction Elements"
WScript.Echo "------------------------------"
For Each oIsapiCgiRestrictionElement In _
        oSection.IsapiCgiRestriction
    WScript.Echo  "GroupID: " & _
        oIsapiCgiRestrictionElement.GroupID
    WScript.Echo  "Description: " & _
        oIsapiCgiRestrictionElement.Description
    WScript.Echo  "Path: " & _
        oIsapiCgiRestrictionElement.Path
    WScript.Echo  "Allowed: " & _
        oIsapiCgiRestrictionElement.Allowed
    WScript.Echo
Next

Inheritance Hierarchy

CollectionElement

   IsapiCgiRestrictionElement

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

CollectionElement Class [IIS 7 and higher]

IsapiCgiRestrictionSection Class [IIS 7 and higher]