Skip to content

Instantly share code, notes, and snippets.

@mercdev
Created May 2, 2015 23:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mercdev/dba8a773c838455b7d38 to your computer and use it in GitHub Desktop.
Save mercdev/dba8a773c838455b7d38 to your computer and use it in GitHub Desktop.
Displays Applications configured in IIS
# 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