Top Menu

Tag Archives Internet Information Services

One of the best practices is run Windows Azure Pack Application Pools on dedicated account. WAP has quite a lot Application Pools and changing each manually is not very comfortable. You can do bulk change using below PowerShell script (Assumption: You use the same identity for each AppPool).

### Change the variables to fit your environment
$userName = "domain\username"
$password = "password"

### Let's start the party!
Import-Module WebAdministration
$appPools = Get-ChildItem IIS:\AppPools | where { $_.Name -like "MgmtSvc-*" }
 
foreach($appPool in $appPools)
{
    $appPool.processModel.userName = $userName
    $appPool.processModel.password = $password
    $appPool.processModel.identityType = 3
    $appPool | Set-Item
    $name = $appPool.name
    Write-Host "$name updated..." -ForegroundColor Green
}
Write-Host "Done!" -ForegroundColor Yellow

Of course you can easily customize the script to other things than the WAP by changing the condition 🙂

Close