Matching Server 2008 w3wp.exe PIDs to Application Pools

I have a new Windows 2008 Server up in t’ cloud and whilst checking it today, I noticed that memory usage was a bit higher than expected.

I have a lot of websites running on this box and each site has its own application pool. Looking in task manager, there are obviously quite a few w3wp.exe processes, but one in particular was using a lot of memory.

I was after a way of finding out which PID belonged to which application pool.

The answer was simple, I just ran this from the command line:

%windir%\system32\inetsrv\appcmd.exe list wp

This then returned all the PIDs and the attached Application Pool name for each one. Happy days.