IIS Application pool PID

前端 未结 9 2122
臣服心动
臣服心动 2020-12-02 11:06

is anyone familiar with a way to get the Application pool that is associated with a process ID ? I am using Win32_Process to query the W3WP services and return the PID now

相关标签:
9条回答
  • 2020-12-02 11:48

    PID of and Application Pool giving its name:

    $AppPoolName = 'AppPoolForSite1'
    (Get-ItemProperty IIS:\AppPools\$AppPoolName -Name WorkerProcesses).Collection.processId
    
    0 讨论(0)
  • If you're running on Windows Server 2008 and you ONLY want the PID, to feed to another script or command, you can use this:

    c:\windows\system32\inetsrv\appcmd list wps /apppool.name:"My Application Pool" /text:WP.NAME
    

    For example, to create a batch script that creates a memory dump of a particular app pool, use this:

    c:\windows\system32\inetsrv\appcmd list wps /apppool.name:"My Application Pool" /text:WP.NAME > "%temp%\pid.txt"
    for /F %%a in (%temp%\pid.txt) do c:\debugger\adplus.exe -hang -o d:\dumps -p %%a
    pause
    
    0 讨论(0)
  • 2020-12-02 11:53

    I just discovered that you can also find this in the UI for IIS 7. Select your web server node and open "Worker Processes". This will show the name of each Application Pool along with its Process ID and utilization details.

    0 讨论(0)
提交回复
热议问题