In development machine if we install the SharePoint on premise(2010 or 2013 SharePoint server) with User or our Id , due to policy if we change our password for installation ID, then We will face issue on access SharePoint site due to password , the work around solution for this is once the installation id password, changed then the app pool and Manage account password also need to be changed, instead changing manually by going to IIS and SharePoint Central administration we can execute the below script on SharePoint server to change the password
App Pool Password change
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
Import-Module WebAdministration
$applicationPools = Get-ChildItem IIS:AppPools | where { $_.processModel.userName -eq "domainusername" }
foreach($pool in $applicationPools)
{
$pool.processModel.userName = "domainusername"
$pool.processModel.password = "password"
$pool.processModel.identityType = 3
$pool | Set-Item
}
Write-Host "Application pool passwords updated..." -ForegroundColor Magenta
Write-Host ""
Read-Host -Prompt "Press Enter to exit"
Managed Account Password change
$m = Get-SPManagedAccount -Identity “domainusername”
Set-SPManagedAccount -Identity $m -ExistingPassword (ConvertTo-SecureString "Password" -AsPlainText -force) –confirm
Hope the handy script helps you to change managed and app pool account password and save few hours of effort.
Happy Coding,
Hariramakrishnan Vasuthevan
Leave a comment