Email notification for Windows builtin backup

Post Reply
admin
Site Admin
Posts: 15
Joined: Tue Apr 05, 2011 12:19 pm

Email notification for Windows builtin backup

Post by admin »

Email notification for Windows builtin backup

Create new task in task scheduler that will be triggered on successful backup. Setup with the following settings:-

Name: Backup Success Email Task
Description: Notifies backup admin of scheduled backup successful completion
Run whether user is logged on or not
Trigger > On event > Log=Microsoft-Windows-Backup/Operational > Source=Backup > Event ID(s)=4
Action: Start a program
Program/script: powershell
Add arguments: Send-MailMessage -To user@test.com -Subject "SWS Backup Completed Successfully" -Body "SWS Backup Completed Successfully" -SmtpServer xxx.xxx.xxx.xxx -From backup@test.com

Save task


Create another task to be triggered on backup failure. This one has a larger event trigger as there are multiple backup failure event codes whereas there is only one backup success event code (4). These triggers need to be entered separately. To facilitate adding multiple triggers,

Create new task as below with only 2x trigger ID's (eg 5 & 8)
Save task
Export task (as .xml)
Open exported task .xml in text editor and duplicate <EventTrigger>'s, changing EventID with below values
Save exported .xml file
Delete task from task scheduler
Import edited task into task scheduler (right click Task Scheduler Library / Import Task)
Save task


Configure Failed backup task with the following settings:-

Name: Backup Failure Email Task
Description: Notifies backup admin of scheduled backup failure
Run whether user is logged on or not
Trigger > On event > Log=Microsoft-Windows-Backup/Operational > Source=Backup > Event ID(s)= 5,8,9,17,22,49,50,52,100,517,518,521,527,528,544,545,546,561,564,612
Action: Start a program
Program/script: powershell
Add arguments: Send-MailMessage -To user@test.com -Subject "Backup FAILED" -Body "Backup FAILED to complete. Check Event viewer" -SmtpServer xxx.xxx.xxx.xxx -From backup@test.com




---------------------------------------------------------------------------------------------------------------------------------------

Send email from powershell with:-

Send-MailMessage -To recipient@emaildomain.com -Subject "Subject" -Body "eMail body" -SmtpServer x.x.x.x -From sender@emaildomain.com


---------------------------------------------------------------------------------------------------------------------------------------




Taken from:-
https://www.bluecompute.co.uk/blogposts ... er-backup/
https://www.get-itsolutions.com/task-sc ... 147750704/
Post Reply