WorkerProcess.GetExecutingRequests Method [IIS 7 and higher]

Gets the requests that are currently assigned to a worker process.

Syntax

objWorkerProcess.GetExecutingRequests(RequestArray);
objWorkerProcess.GetExecutingRequests RequestArray

Parameters

Name

Definition

RequestArray

An array to hold HttpRequest objects.

Return Value

This method does not return a value.

Remarks

This method takes an empty array as an OUT parameter, which it fills with HttpRequest objects.

Example

The following example gets information about the requests that are currently queued for each worker process.

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

' Get the worker processes.
Set oW3WPs = oWebAdmin.InstancesOf("WorkerProcess")

For Each oW3WP In oW3WPs

    ' Place the requests queued for a process into an array.
    oW3WP.GetExecutingRequests arrReqs

    ' Show the number of queued requests.
    If IsNull(arrReqs) Then
        WScript.Echo "No currently executing requests."
    Else
        ' Display the number of requests.
        WScript.Echo "Number of currently executing requests: " & _
            UBound(arrReqs) + 1
        WScript.Echo

        ' List the properties of each request.
        For Each oRequest In arrReqs
            WScript.Echo "Module: " & "[" & oRequest.CurrentModule & "]"
            WScript.Echo "Verb:" & "[" & oRequest.Verb & "]"
            WScript.Echo "HostName: " & "[" & oRequest.HostName & "]"
            WScript.Echo "Url: " & "[" & oRequest.Url & "]"
            WScript.Echo
        Next
    End If
Next

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

HttpRequest Class [IIS 7 and higher]

WorkerProcess Class [IIS 7 and higher]

Other Resources

View Currently Executing Requests in a Worker Process