次の方法で共有


WorkerProcess.GetExecutingRequests メソッド 2

ワーカー プロセスに現在割り当てられている要求を取得します。

構文

objWorkerProcess.GetExecutingRequests(RequestArray);  
objWorkerProcess.GetExecutingRequests RequestArray  

Parameters

名前 Definition
RequestArray HttpRequest オブジェクトを保持する配列。

戻り値

このメソッドは値を返しません。

解説

このメソッドは、空の配列を OUT パラメーターとして受け取り、HttpRequest オブジェクトを格納します。

次の例では、ワーカー プロセスごとに現在キューに登録されている要求に関する情報を取得します。

' 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  

要件

説明
クライアント - Windows Vista 上の IIS 7.0
- Windows 7 上の IIS 7.5
- Windows 8 上の IIS 8.0
- Windows 10 上の IIS 10.0
[サーバー] - Windows Server 2008 上の IIS 7.0
- Windows Server 2008 R2 上の IIS 7.5
- Windows Server 2012 上の IIS 8.0
- Windows Server 2012 R2 上の IIS 8.5
- Windows Server 2016 上の IIS 10.0
Product - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF ファイル WebAdministration.mof

参照

HttpRequest クラス
ワーカー プロセスで現在実行中の要求を表示する
WorkerProcess クラス