Wednesday, July 8, 2015

PowerShell script to restart application pools

Two line PowerShell script to restart all application pools on a server

1 #Import WebAdministration
2 Import-Module WebAdministration
3 #Find, pipe and restart
4 (Get-Item "IIS:\Sites\*" | Select-Object applicationPool).applicationPool | % { Restart-WebAppPool $_ }
5

No comments:

Post a Comment