Created
September 27, 2017 12:50
-
-
Save db/c77cfe34fe0f5b580ccf28610cd2e825 to your computer and use it in GitHub Desktop.
Start AppPool that has stopped
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module WebAdministration | |
set-Location IIS:\AppPools | |
$AppPools = dir | |
foreach ($AppPool in $AppPools) | |
{ | |
Write-Host "$AppPool.Name -> checking" | |
if($AppPool.state -ne "Started") | |
{ | |
Write-Host "- $AppPool.Name found stopped - starting it" | |
Start-WebAppPool -Name $AppPool.Name | |
Write-Host "- $AppPool.Name started - OK" | |
} | |
else | |
{ | |
Write-Host "- $AppPool.Name is running - OK" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment