Last active
April 9, 2018 15:49
-
-
Save danjpadgett/fb8b5eedbb9def08b19c5a5e2590d044 to your computer and use it in GitHub Desktop.
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
<# | |
.SYNOPSIS | |
Checks WSUS App Pool | |
.DESCRIPTION | |
Script will check status of WSUS APP Pool and if 'stopped' will email. Setup script as scheduled task on WSUS instance. | |
.NOTES | |
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') | |
{ | |
#Null | |
} | |
else | |
{ | |
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