Last active
May 2, 2016 20:53
-
-
Save iAnatoly/2e821b5a9fbfbb9abca2 to your computer and use it in GitHub Desktop.
3.5 ways to display IIS App pool identities (usernames and passwords)
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
[System.Reflection.Assembly]::LoadFrom( “C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll” ) | |
$mgr = New-Object Microsoft.Web.Administration.ServerManager | |
$mgr.ApplicationPools | % { $pm = $_.ChildElements[“processModel”]; Write-Host $_.Name $pm.Attributes[“userName”].Value$pm.Attributes[“password”].Value } | |
# Or, if you do not appreciate the brevity: | |
[System.Reflection.Assembly]::LoadFrom( “C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll” ) | |
$mgr = New-Object Microsoft.Web.Administration.ServerManager | |
$pools = $mgr.ApplicationPools | |
foreach ($pool in $pools) | |
{ | |
$processModel = $pool.ChildElements[“processModel”]; | |
Write-Host $pool.Name $processModel.Attributes[“userName”].Value $processModel.Attributes[“password”].Value | |
} |
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
$pools = ([ADSI]“IIS://localhost/W3SVC/AppPools”).Children | |
foreach ($pool in $pools) | |
{ | |
Write-Host $pool.Name, $pool.Properties.WAMUserName, $pool.Properties.WAMUserPAss | |
} |
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
Get-WMIObject -namespace root/MicrosoftIISv2 -Class IIsApplicationPoolSetting -Property Name, WAMUserName, WAMUserPass | select Name,WAMUserName, WAMUserPass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment