Created
December 25, 2014 09:18
-
-
Save tany3/2373939b8795c043da58 to your computer and use it in GitHub Desktop.
List of IIS Applications
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
# | |
#see http://melcher.it/2013/03/powershell-list-all-iis-webapplications-net-version-state-identity/ | |
# | |
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 | |
} | |
} | |
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