Specifies size limits on incoming HTTP requests.
class RequestLimitsElement : EmbeddedObject
This class contains no methods.
The following table lists the properties exposed by the RequestLimitsElement class.
Name | Description |
|---|
HeaderLimits | A HeaderLimitsSettings value that specifies HTTP header sizes. |
MaxAllowedContentLength | A read/write uint32 value that specifies the maximum length, in bytes, of content in a request. The default is 30000000 (approximately 30 megabytes.) |
MaxQueryString | A read/write uint32 value that specifies the maximum length, in bytes, of the query string. The default is 2048. |
MaxUrl | A read/write uint32 value that specifies the maximum length, in bytes, of the request URL. The default is 260. |
This class contains no subclasses.
Instances of this class are contained in the RequestLimits array property of the RequestFilteringSection class.
This class integrates into IIS 7 the RequestLimits settings of the URLScan tool used by previous versions of IIS.
Note: |
|---|
You must install the Request Filtering Module (Modrqflt.dll) for the settings in this class to take effect. |
The following example displays all the properties of the RequestLimitsElement class.
' Connect to the WMI WebAdministration namespace.
Set objWMIService = GetObject("winmgmts:root\WebAdministration")
' Get the RequestFilteringSection.
Set oRequestFilteringSection = objWMIService.Get( _
"RequestFilteringSection.Path='MACHINE/WEBROOT/APPHOST',Location=''")
' Set a variable to the RequestFilteringSection.RequestLimits property,
' which contains an array of RequestLimitsElement objects.
Set oRequestLimitsElement = oRequestFilteringSection.RequestLimits
' Display the path and list the non-array RequestLimitsElement properties.
WScript.Echo "[Request Limits]"
WScript.Echo "Path: " & oRequestFilteringSection.Path
WScript.Echo "maxAllowedContentLength: " & _
oRequestLimitsElement.maxAllowedContentLength
WScript.Echo "maxUrl: " & oRequestLimitsElement.maxUrl
WScript.Echo "maxQueryString: " & oRequestLimitsElement.maxQueryString
WScript.Echo
' List the contents of the RequestLimitsElement.HeaderLimits.HeaderLimits
' property, which contains an array of HeaderLimitsElement instances.
WScript.Echo vbtab & "[Header Limits]"
For Each oHeaderLimit In oRequestLimitsElement.HeaderLimits.HeaderLimits
WScript.Echo vbtab & "Header: " & oHeaderLimit.Header
WScript.Echo vbtab & "Header size limit: " & oHeaderLimit.sizeLimit
WScript.Echo
Next
EmbeddedObject
RequestLimitsElement
Type | Description |
|---|
Client | Requires IIS 7 on Windows Vista. |
Server | Requires IIS 7 on Windows Server 2008. |
Product | IIS 7 |
MOF file | WebAdministration.mof |
Reference