To setup performance counters or troubleshoot application pool issues, we might need to find out the application pool process ID: Below are the method respective to IIS 6.0 and IIS 7.
IIsApp.vbs is used to list worker processes. Given an application pool identifier, it gets report all of the process identifiers (PIDs) currently running w3wp.exe processes.
IIS must be running in worker process isolation mode. This tool uses WMI. It cannot be used to configure a remote IIS server
Physical Location: %SystemRoot%\System32
To run got to Start -> Run -> cmd and in the command prompt type iisapp
IIS 7 provides a new command-line tool, Appcmd.exe, to configure and query objects on your Web server, and to return output in text or XML
To Run go to Start -> Run -> cmd -> change the location to %SystemRoot%\System32\inetsrv and type the command "appcmd list wp"