How to Get SharePoint Farm Account Password using PowerShell?
Requirement: Had to take over a SharePoint Farm, and we don’t have the Farm Account Password! We needed the credentials of the SharePoint Farm account.
Get SharePoint Farm Account Password:
SharePoint farm account user name and password can be retrieved with this little trick: The Central Admin site uses the SharePoint Farm account. So, let’s retrieve the credentials of the SharePoint Central admin App Pool. This tiny script gets you the user name and password of the SharePoint Farm account.
Import-Module WebAdministration
#Get Central Admin App Pool - which Runs on FARM account
$CAPool = Get-ChildItem -Path IIS:\AppPools\ | Where { $_.Name -eq "SharePoint Central Administration v4" }
#Get User Name and Password for Farm Account
$CAPool.ProcessModel.UserName
$CAPool.ProcessModel.Password
That’s All! Now, you have the Farm Account Password! Similarly, You can also retrieve any managed account password or IIS application pool passwords. One can argue on misuse of this. But this is for information/recovery purposes only.