Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save macna/ac7e8c356927b10e085d to your computer and use it in GitHub Desktop.
Save macna/ac7e8c356927b10e085d to your computer and use it in GitHub Desktop.
PowerShell scripts for sending Windows Server Backup success/failure notifications. Using these scripts, you can create Windows scheduled tasks that are triggered on the event IDs of Windows Server Backup. For success notifications the task should be triggered on event ID '4'. For failure notifications the task should be triggered on event IDs '…
$hostname = hostname
Send-MailMessage -To admin@contoso.com -From "$hostname@contoso.com" -Priority High -SmtpServer smtp.contoso.com -Subject "$hostname - Backup Failure" -Body "A backup on $hostname has failed."
$hostname = hostname
Send-MailMessage -To admin@contoso.com -From "$hostname@contoso.com" -Priority Low -SmtpServer smtp.contoso.com -Subject "$hostname - Backup Success" -Body "A backup on $hostname has succeeded."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment