param ( [Parameter(Mandatory=$true)][string] $Account # PROD\TestgMSAAccount ) Import-Module WebAdministration $AppPoolArray = "API Exchange Services", "API Sql", "API Web Garden", "API Workflow", "API Secure Services", "API SQL Web Services", "API Web Service Garden", "API Workflow Web Services", "EmpowerID", "EmpowerID Exchange Services", "EmpowerID IDP", "EmpowerID IDPs", "EmpowerID SQL Web Services", "EmpowerID UI", "EmpowerID Web API", "EmpowerID Web CDN", "EmpowerID Web Reports", "EmpowerID Web Service Garden", "EmpowerID Web Services", "EmpowerID Workflow Web Services" foreach ($AppPool in $AppPoolArray) { Set-ItemProperty "IIS:\AppPools\$AppPool" -name processModel -value @{userName=$Account;identitytype=3} -ErrorAction SilentlyContinue }