Identify which application pool is associated with which W3WP.exe process

Identify which application pool is associated with which W3WP.exe process

Well this is a sticky: http://blogs.thesitedoctor.co.uk/tim/2007/10/16/Identify+Which+Application+Pool+Is+Associated+With+Which+W3WPexe+Process.aspx

Identify which application pool is associated with which W3WP.exe process

Today I needed to identify a site that was causing the W3WP.exe process to run at 100% CPU. I had hoped that there was some clever way of identifying the site from the process id but no such luck. The issue was escalated because we have multiple sites under each application pool.It was done like this to keep the overheads minimal (each W3WP.exe process needs circa 25MB to run) but it makes identifying rogue code difficult.
If you need to identify which W3WP.exe relates to which Application Pool, open CMD, navigate to your System32 directory and type:
cscript iisapp.vbs
That’ll then list the relevant W3WP.exe processes, process id and their app pool name.:) -simple and useful, just the way I like it!