PowerShell : Modifying Web AppPool Account

By | July 28, 2010


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


Leave a Reply