There are many instances where you have to provide a custom account identity to an App pool in IIS. There are also instances where you might have forgotten the password for that account which has to be set as identity for that Application Pool. In such cases, you can use the APPCMD command to retrieve the password for that user. One thing to remember is that there has to be an app pool existing in the machine already which has been assigned that account’s Identity for us to retrieve it’s password. Please note: This can be used for IIS 7 and above.
appcmd is an IIS tool used to manage IIS server. It provides many functions that can be used to manager server related activities like create/configure sites, start/recycle/stop app pools, etc.
Retrieve Password of an App Pool identity 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:*
For example: I have an app pool in my IIS named SampleAppPool which has been assigned a particular account’s identity whose password I would like to retrieve. So I would enter the below command in command prompt.
Press enter and the result will be as shown below. Due to security reasons, I have removed the username and password from the image but trust me, it shows the username and password there.Hope this helps!