Link to home
Start Free TrialLog in
Avatar of nav2567
nav2567Flag for United States of America

asked on

Identify app pool used by IIS site

Hello,

I have a lot of web sites on my IIS server.  If I know the name of the application pool, what is the best way to quick identify which site is using it?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dfke
dfke

Hi,

sorry I missread that you said you have a lot of sites.

  • create a new file calls listapppool.ps1 with the following content:


[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")

$sm = New-Object Microsoft.Web.Administration.ServerManager

foreach($site in $sm.Sites)
{
    $root = $site.Applications | where { $_.Path -eq "/" }
    Write-Output ("Site: " + $site.Name + " | Pool: " + $root.ApplicationPoolName)
}

Open in new window

  • Open an administrative command line prompt and run powershell.

  • Run the script in powershell:

.\listapppool.ps1

Open in new window

it will display all sites and their corresponding Application Pools.

Cheers
Avatar of nav2567

ASKER

Thanks, everyone.