Finding the W3WP worker process PID and associated ID

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 (5)

  1. says:

    Thanks for your post. I used it as practical guide for troubleshooting.

  2. Anonymous says:

    For powershell use:

    (C:Windowssystem32inetsrvappcmd.exe list wps).Split(" ")[1].substring(1,4)

  3. Anonymous says:

    You can also use Perfmon and add the Process counter  > ID Process and add all of the w3wp process to the counter. This will give you the process ID's.  You can have this side by side other perfmon counters.  It will give you the PID of the actual w3wp process. Which has been a mystery for a while forcing folks to reg hack and do crazy things.

  4. Anonymous says:

    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}}

  5. Thanks for the feedback, I like to see improvments and feedback on the articles here.