Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to audit the application pools on an IIS6 server, I want to check which websites relate to each application pool and the .NET version they are running. How can I do this without manually going though the interface and looking at each one in turn?

share|improve this question

1 Answer 1

Use iisapp.vbs to list app pools:

iisapp.vbs 

Unfortunately, unlike in IIS7, the app pools have no idea which .NET version they are running, they are just loading the filter requested by the site, so you have to iterate through the sites and pull the info. This StackOverflow answer has a suggested script for walking the web sites and listing their app pool and .NET versions.

(Script credit to @Kev at StackOverflow)

# Walk sites
$allsites = ([adsi]"IIS://Localhost/W3SVC").children | where { $_.SchemaClassName -eq "IIsWebServer" }
$pools = @()

foreach($site in $allsites)
{
  $path = "IIS://Localhost/W3SVC/" + $site.Name + "/root"
  $siteRoot = [adsi]$path
  $sitePool = $siteRoot.AppPoolId

  $aspx = $siteRoot.ScriptMaps | where { $_.StartsWith(".aspx") }

  if( $aspx.Contains("v1.1")) {
    $runtime = "1.1"
  } elseif ($aspx.Contains("v2.0")) {
    $runtime = "2.0"
  } elseif( $aspx.Contains("v4.0")) {
    $runtime = "4.0"
  } else {
    $runtime = "Unknown"
  }

  $v =  @{AppPool = $siteRoot.AppPoolId; RunTime = $runtime; SiteId = $site.Name}
  $pools += $v
}

$pools | Sort-Object { $_.AppPool } | % { Write-Host $_.AppPool $_.SiteId $_.RunTime }
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.