PowerShell : Modifying Web AppPool Account
I think you may already know Set-SPServiceApplicationPool. This command can be used to modify apppool account for service application - but it doesn’t work for Web Application. I am looking for Set-SPWebApplicationPool but I can not find it anywhere.
So here is the PowerShell script
param([string] $url, [string] $account)
$SPWebApp = Get-SPWebApplication $url
$SPManagedAccount = Get-SPManagedAccount –Identity $account
$SPWebApp.ApplicationPool.ManagedAccount = $SPManagedAccount