Created
January 19, 2022 05:33
-
-
Save chiguniiita/0302f88e8ac1a4336c32e465243e0790 to your computer and use it in GitHub Desktop.
PowerShell script to stop all ApplicationPools in IIS.
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 | |
foreach ($POOL in Get-IISAppPool){ | |
$POOL_NAME = $POOL.Name | |
if((Get-WebAppPoolState -Name $POOL_NAME).Value -ne 'Stopped'){ | |
Write-Output ('Stopping Application Pool: {0}' -f $POOL_NAME) | |
Stop-WebAppPool -Name $POOL_NAME | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment