We have a requirement to change our application's IIS app pool password everytime it expires. Currently, we have to manually login to each server adn run a snippet of PowerShell code which changes the password. Here is the code we run on each server on PS: Import-Module WebAdministration $applicationPools = Get-ChildItem IIS:AppPools | where { $_.processModel.userName -eq "Domain\XXXXX12345" } foreach($pool in $applicationPools) { $pool.processModel.userName = "Doma\XXXXX12345" $pool.processModel.password = "XXXXXXXXXXXXXXXXX" $pool | Set-Item } Write-Host "Application pool passwords updated..." -ForegroundColor Magenta Write-Host "" Read-Host -Prompt "Press Enter to exit" But is there a way we can do the same for a list of servers/VMs at once instead of having to login to each server, open PowerShell or IIS and manually change it on each server? Any help would be greatly appreciated!
Here is the code we run on each server on PS: Import-Module WebAdministration $applicationPools = Get-ChildItem IIS:AppPools | where { $_.processModel.userName -eq "Domain\XXXXX12345" } foreach($pool in $applicationPools) { $pool.processModel.userName = "Doma\XXXXX12345" $pool.processModel.password = "XXXXXXXXXXXXXXXXX" $pool | Set-Item } Write-Host "Application pool passwords updated..." -ForegroundColor Magenta Write-Host "" Read-Host -Prompt "Press Enter to exit" But is there a way we can do the same for a list of servers/VMs at once instead of having to login to each server, open PowerShell or IIS and manually change it on each server?
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)