39

I've recently upgraded my development machine from Windows XP to Windows 7. How can I tell which w3wp.exe process belongs to which App Pool on a desktop running Windows 7?

But what about on my desktop?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
wweicker
  • 4,833
  • 5
  • 35
  • 60
  • [Find Process Id of an IIS Site by Site Name](http://www.reza-aghaei.com/find-process-id-of-an-iis-site-by-site-name/) – Reza Aghaei Mar 14 '18 at 20:29

4 Answers4

64

If you open IIS Manager, go to the root node in the tree on the left that represents your computer (should be labeled as your computer name).

In the Features View to the right, you'll see a section called IIS. Under that you'll see Worker Processes. Select that and it should show you all running worker processes and some basic info, including ProcessId.

You can correlate that ProcessId to the matching process in the Processes tab in Task Manager (showing processes from all users, and including the ProcessId column in the results).

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
moribvndvs
  • 42,191
  • 11
  • 135
  • 149
28

You can also go into Task Manager and add the PID and Command Line columns to see the information you need.

enter image description here

The blacked out content contains the names of the individual processes.

I find this workflow just slightly less cumbersome than having to navigate away from what I may be looking at in IIS just to see this information (to then have to navigate right back to where I was).

Michael
  • 3,099
  • 4
  • 31
  • 40
  • 2
    I like this. With keyboard shortcuts (Ctrl-Shift-Escape, "w3") this is a lot quicker than firing up IIS manager and using several mouse clicks here and there to make it give you the information. And it refreshes automatically. – sehe Nov 17 '14 at 10:40
3

I know this is an old post, but here is a way to enumerate the app pool and process IDs using C# code.

void Main()
{
    using (var serverManager = new ServerManager())
    {
        foreach (var appPool in serverManager.ApplicationPools)
        {
            string.Format("App pool name = {0}", appPool.Name).Dump();

            foreach (var workerProcess in appPool.WorkerProcesses)
            {
                string.Format("Process id = {0}", workerProcess.ProcessId).Dump();
            }
        }

        "Done".Dump();
    }
}

Make sure you reference Microsoft.Web.Administration.dll in %WINDIR%\System32\inetsrv.

If you don't have LINQPad, replace the dumps with Console.WriteLine(s)

Ajay
  • 18,086
  • 12
  • 59
  • 105
Martin Lottering
  • 1,624
  • 19
  • 31
0

There are two ways in which I prefer "task manager" version.

Option A - Using task manager,

  1. Open Task Manager

  2. Add "command line" column as shown in the images.

    enter image description here enter image description here

Option B - Using PowerShell

  1. Run the follow commands

    cd C:\Windows\System32\inetsrv\
    .\appcmd list wp
    

    enter image description here

KyleMit
  • 30,350
  • 66
  • 462
  • 664