Created
May 2, 2015 23:04
-
-
Save mercdev/dba8a773c838455b7d38 to your computer and use it in GitHub Desktop.
Displays Applications configured in IIS
This file contains hidden or 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
# note: requires Web Administration (IIS) Provider for Windows PowerShell | |
# http://technet.microsoft.com/en-us/library/ee909471(v=ws.10).aspx | |
cls | |
try | |
{ | |
Import-Module WebAdministration | |
#Get-WebApplication | |
$webapps = Get-WebApplication | |
$list = @() | |
foreach ($webapp in get-childitem IIS:\AppPools\) | |
{ | |
$name = "IIS:\AppPools\" + $webapp.name | |
$item = @{} | |
$item.WebAppName = $webapp.name | |
$item.Version = (Get-ItemProperty $name managedRuntimeVersion).Value | |
$item.State = (Get-WebAppPoolState -Name $webapp.name).Value | |
$item.UserIdentityType = $webapp.processModel.identityType | |
$item.Username = $webapp.processModel.userName | |
$item.Password = $webapp.processModel.password | |
$obj = New-Object PSObject -Property $item | |
$list += $obj | |
} | |
$list | 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