Buy 2 Classes, Get 1 Free!

How to tell which Application pool an IIS worker process belongs to

Recently speaking at a conference where I was presenting an IIS crash course, several attendees came up to me after the session and asked how they could tell which IIS worker process belonged to which application pool. This information is presented in the graphical task manager, but is tricky to find using PowerShell.

Because so many folks were curious, I decided to share with everyone.  Here ya go!

PS> Get-WmiObject –class win32_process -filter 'name="w3wp.exe"' | Select-Object –Property Name, ProcessId, @{n='AppPool';e={$_.GetOwner().user}} 

IIS and PowerShell combined rock!

The Inadvertent IIS administrator

Jason Helmick
Director of PowerShell Technologies
Interface Technical Training

Share your thoughts...

We encourage people to join in on the discussion. Please keep in mind however, that all comments are moderated according to our comment policy, and all links are nofollow. Do not use keywords in the name field. Let's keep the conversation professional and meaningful.