Created
October 8, 2013 07:54
-
-
Save bentk/6881156 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
Import-Module WebAdministration | |
Get-WebApplication | |
$webapps = Get-WebApplication | |
$list = @() | |
foreach ($webapp in get-childitem IIS:\AppPools\) | |
{ | |
$name = "IIS:\AppPools\" + $webapp.name | |
$item = @{} | |
$item.Password = $webapp.processModel.password | |
$item.Username = $webapp.processModel.userName | |
$item.Version = (Get-ItemProperty $name managedRuntimeVersion).Value | |
$item.UserIdentityType = $webapp.processModel.identityType | |
$item.State = (Get-WebAppPoolState -Name $webapp.name).Value | |
$item.WebAppName = $webapp.name | |
$obj = New-Object PSObject -Property $item | |
$list += $obj | |
} | |
$list #| ft -auto # -column 6 # Format-Table -a -Property "WebAppName", "Version", "State", "UserIdentityType", "Username", "Password" | |
} | |
catch | |
{ | |
$ExceptionMessage = "Error in Line: " + $_.Exception.Line + ". " + $_.Exception.GetType().FullName + ": " + $_.Exception.Message + " Stacktrace: " + $_.Exception.StackTrace | |
$ExceptionMessage | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment