Identifying the Worker Process Process ID (IIS 6.0)
The nature of some problems, especially those in which an application is hanging, leaking memory, or generally misbehaving, make it necessary to know which application pool goes with which worker process (or processes, if Web gardens are enabled). With the advent of the new worker process isolation mode in IIS 6.0, a Web server potentially can have thousands of individual instances of W3wp.exe running at any given time. Looking for the process ID in Task Manager is pointless in such a case because it is impossible to differentiate between the different worker processes servicing the application pools.
In worker process isolation mode, you can find the process ID by using the command-line script Iisapp.vbs, which is stored in systemroot\System32, and is designed specifically to obtain a list of running worker processes, their process IDs, and the application pool names.
Important You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /user:MyComputer\Administrator cmd to open a command window with administrator rights and then type cscript.exeScriptName (include the script's full path and any known parameters).
To find a worker process ID by using Iisapp.vbs
For more information about using Iisapp.vbs, see Listing Running Web Applications Using Iisapp.vbs.
In earlier versions of IIS and when IIS 6.0 is running in IIS 5.0 isolation mode, identifying the process ID is relatively easy. If a component installed in a COM+ library application has been activated from a worker process, the procedure for identifying the process ID is the same.
Important You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".
To find the process ID in versions prior to IIS 6.0 and in IIS 5.0 isolation mode