How to find which w3wp.exe belongs to which application pool(Kristofer Gafvert, June 20, 2006)
If you have multiple application pools on your IIS 6.0 web server you have certainly already noticed (in Task Manager) that you have multiple w3wp.exe processes running. If you notice a problem with one of these processes (for example consuming much memory, or taking too much CPU power) the following question arises: How do I know which application pool this process belongs to, so I know what application is causing this? It may sound like an easy to answer question, and it is, if you know the solution!
The command-line script iisapp.vbs can be used to view which application pool a worker process belong to (a w3wp.exe process in Task Manager). This script is stored in the systemroot\system32 folder. To run this script open a command prompt.
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
W3WP.exe PID: 1188 AppPoolId: DefaultAppPool
The example above tells us that the w3wp.exe with PID 1188 belongs to the application pool called DefaultAppPool. The syntax for this script is:
iisapp [/a AppPoolName | /p PID]
So you can also search for a specific application pool by specifying the PID, or vice versa (search for a PID by specifying the application pool name).