Powershell – Update All Application Pool Identity User Password

Powershell – Update All Application Pool Identity User Password
7 votes, 5.00 avg. rating (98% score)

Introduction

If Application Pools identity credentails should be changed due to any inbuilt policy, then we have to go to all application pools to change new password. This is a bit tedious if many application pools are there. If application pools are run by managed accounts, SharePoint will handle password change by itself. In reality there will be certain app pools that should be manually updated with new password. The following script will update all application pools identity user password that are running by the user

 
Import-Module WebAdministration
$applicationPools = Get-ChildItem IIS:\AppPools | where { $_.processModel.userName -eq "domain\username" }

foreach($pool in $applicationPools)
{
    $pool.processModel.userName = "domain\username"
    $pool.processModel.password = "newpassword"
    $pool.processModel.identityType = 3
    $pool | Set-Item
}

Write-Host "Application pool passwords updated..." -ForegroundColor Magenta 
Write-Host ""  

Conclusion

Hope this script will help you to change the passwords quickly rather than spending time changing manually

April 3, 2015 В· Adi В· No Comments
Tags: , , ,  В· Posted in: Powershell, Sharepoint 2010, SharePoint 2013

Leave a Reply

What is 5 + 10 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)