Skip to content

Instantly share code, notes, and snippets.

Last active April 9, 2018 15:49
What would you like to do?
Checks WSUS App Pool
Script will check status of WSUS APP Pool and if 'stopped' will email. Setup script as scheduled task on WSUS instance.
Version: 1.0
Author: dpadgett
Creation Date: 07/02/17
Purpose/Change: Production
$smtpserver = "<hostname/IP>"
$recipients = "<mailrecipient>"
$senderaddress = "<sender>"
Import-Module WebAdministration
Get-ChildItem –Path IIS:\AppPools
$pools = 'WsusPool'
$state = Get-ItemProperty "IIS:\AppPools\$($pools[0])" | select state
$body = "WSUS App Pool on SCCM Site Server '<ConfigMgr Server>' has stopped - Please log in to to manually start "
if ($state -match 'Started')
Send-MailMessage -SmtpServer $smtpserver -Port 25 -To $recipients -From $senderaddress -Subject "WSUS App Pool Error on SCCM Site Server!" -Body $body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment