There is often a need to determine which application pool a w3wp.exe process is responsible for. There are separate commands for determining this in depending on the version of IIS.
When running IIS 6 the following command can be used in a command prompt:
This process ID will match what is displayed on the Task Manager.
The iisapp command will not work on IIS 7 however Microsoft provides an equivalent command:
%windir%\system32\inetsrv\appcmd.exe list wp