Read IIS App Pool Identity passwords

Hey,

I recently came across a scenario to retrieve password from IIS App Pool Identity.

Writing a script for a local machine, was pretty simple. Found many blogs, following were 2 options which most bloggers recommended. I bet, first blog each one of us would land up to is of Mike F Robbins.

Get-CimInstance -Namespace root/MicrosoftIISv2 -ClassName IIsApplicationPoolSetting -Property Name, WAMUserName, WAMUserPass | ? { $_.Name -like “*TestApp Pool” } | select Name, WAMUserName, WAMUserPass
Tweak it a little for getting details of the App Pool you wish for, in this case I have an App Pool “TestApp Pool“. Dont forget to add * before the app pool name.
Get-CimInstance -Namespace root/MicrosoftIISv2 -ClassName IIsApplicationPoolSetting -Property Name, WAMUserName, WAMUserPass | ? { $_.Name -like “*TestApp Pool” } | select Name, WAMUserName, WAMUserPass
Second option that you would come across would be following
cmd.exe /c $Env:WinDir\System32\inetsrv\appcmd.exe list apppool “TestApp Pool” /text:ProcessModel.Password
Third option I came across was the following.
Import-Module WebAdministration
(Get-ChildItem IIS:\AppPools | Where-Object { $_.Name -eq “TestApp Pool” } ).ProcessModel.Password
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s