Skip to content

Instantly share code, notes, and snippets.

@tany3
Created December 25, 2014 09:18
Show Gist options
  • Save tany3/2373939b8795c043da58 to your computer and use it in GitHub Desktop.
Save tany3/2373939b8795c043da58 to your computer and use it in GitHub Desktop.
List of IIS Applications
#
#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