Finding the W3WP worker process PID and associated ID
This article has been moved to its new home here: https://benperk.github.io/msdn/2011/2011-12-finding-the-w3wp-worker-process-pid-and-associated-id.html
When you have multiple websites running under different application pools on the same server, you may need to trouble shoot a specific worker process.
On Windows 2003 and Internet Information Services 6 (IIS6), I use the iisapp.vbs script as shown in following command, as shown in Figure 1:
Figure 1, Find AppPoolId using IIS 6
On Windows 2008 and Internet Information Services 7 (IIS 7 or IIS 7.5) or Windows 2012 (IIS 8 or IIS 8.5), I use the appcmd application passing it the wps parameter as displayed below, as shown in Figure 2:
Figure 2, Find applicationPoolId using IIS 7, IIS 7.5, IIS 8 or IIS 8.5
Then, if required I can use, for example, Debug Diag or ProcDump to get a memory dump of the worker process which is experiencing the problem.
Then use the memory dump to analyze and find the root cause of the problem.
Comments
- Anonymous
September 10, 2013
Thanks for your post. I used it as practical guide for troubleshooting. - Anonymous
March 06, 2014
For powershell use:(C:Windowssystem32inetsrvappcmd.exe list wps).Split(" ")[1].substring(1,4) - Anonymous
April 11, 2014
The comment has been removed - Anonymous
January 08, 2015
Another way to pull this information using powershell:get-wmiobject -class win32_process -filter "name='w3wp.exe'" | Select-Object Name, ProcessId, @{n='AppPool';e={$_.GetOwner().user}} - Anonymous
July 29, 2015
Thanks for the feedback, I like to see improvments and feedback on the articles here.