0

dir IIS:\AppPools clearly outputs the Applications assigned to each AppPool under a "Applications" tab.

My problem is I cant seem to select just that property, plus I'm not able to locate it using Get-Member.

enter image description here

What am I missing?

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
JustAGuy
  • 5,151
  • 11
  • 41
  • 55
  • I'm not too familiar with IIS, but those members seem to be those of an application pool. Have you tried selecting an `Item` or a `ChildElements` member? – Ansgar Wiechers Oct 05 '14 at 16:04

2 Answers2

0

You can use this syntax to view most available properties and their values on an AppPool:

ls IIS:\AppPools | where {$_.Name -eq "NameOfYourAppPool"}| fl *
Raf
  • 9,681
  • 1
  • 29
  • 41
0

As described in this answer to a related question, what looks like a property of an AppPool item as shown by the Get-Item or Get-Child-Item commands is actually a calculated column for display purposes. That's why it doesn't show up with Get-Member.

This calculated column uses Get-WebConfigurationProperty behind the scenes.

To get the web applications for a Pool as web configuration objects you can use this function that I wrote:

filter Get-WebApplicationForPool()
{
    $s = $_.Name
    $filter = "system.applicationHost/sites/site/application[@applicationPool='$s']"
    Push-Location .
    Set-Location "IIS:\Sites"
    Get-WebConfiguration -filter $filter -PSPath "IIS:\Sites" 
    Pop-Location
}

Example:

Set-Location IIS:\AppPools
Get-Item "DefaultAppPool" | Get-WebApplicationForPool
weblorin
  • 328
  • 3
  • 11