Skip to content

Instantly share code, notes, and snippets.

@DorukUlucay
Last active April 10, 2024 12:26
Show Gist options
  • Save DorukUlucay/cb176a829a22a3b6b76db3b7cd2a0d85 to your computer and use it in GitHub Desktop.
Save DorukUlucay/cb176a829a22a3b6b76db3b7cd2a0d85 to your computer and use it in GitHub Desktop.
Retrieve Password of an App Pool identity account
echo off
REM Get info of given app pool
color a
set /p apppool= Which one ?
cd \
cd C:\Windows\System32\inetsrv
appcmd.exe list apppool %apppool% /text:* | find "password"
PAUSE

Retrieve Password of an App Pool identity account

(from the source https://amoghnatu.net/2015/01/15/get-password-for-iis-application-pool-account/)

  • To retrieve password for an app pool identity account, open the command prompt in administrative mode.

  • Navigate to C:\Windows\System32\inetsrv directory. This is the location where appcmd.exe exists.

  • Type the below command and press enter. appcmd.exe list apppool <<app_pool_name>> /text:*

  • find user and pass in the output

@Siphonophora
Copy link

Thanks. The /text:* has a lot of useful info like the username and account type which is what I needed.

@BlakesHeaven
Copy link

BlakesHeaven commented Nov 1, 2023

Perfect - thanks.
I updated mine to:

@echo off
echo Get info of given app pool...
color a
set /p apppool= Which one ?
cd \
cd C:\Windows\System32\inetsrv
appcmd.exe list apppool %apppool% /text:* | find "userName"
appcmd.exe list apppool %apppool% /text:* | find "password"
PAUSE

Also note that this needs to be run as Admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment