Skip to content
Tech Shizz Logo

An Engineers Blog

  • TechShizz
  • blog

Send an E-mail deprecated in Server 2012 R2?

Posted on February 23, 2021 By rich No Comments on Send an E-mail deprecated in Server 2012 R2?

Why do Microsoft do this???

They giveth, and then they taketh away!


If you want task scheduler to send an email on event here is a workaround for the deprecated “Send an Email” option in the task scheduler.

This example will show you how to set up emails to be sent on Windows Server Backup Success and failure.
Backup Failure Email
1. Download sendEmail by clicking here
2. Copy the sendEmail.exe to a folder at C:backup_script
3. Open Notepad, paste this and save the file as a batch file:

sendEmail -f [email protected] -t [email protected] -u “TechShizz – HVExchange Full Backup Failure” -m Failure Event for Windows Server Backup has been logged. -s <serverIP> -xu SMTP_Username -xp SMPT-Userpassword

 
4. Open task scheduler (taskschd.msc) and create a task.
a. Create a custom trigger which will cover all failed backup events – you can use this XML query:
 
<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">[System[Provider[@Name='Microsoft-Windows-Backup'] and (EventID=5 or EventID=8 or EventID=9 or EventID=17 or EventID=22 or EventID=49 or EventID=50 or EventID=52 or EventID=100 or EventID=517 or EventID=518 or EventID=521 or EventID=527 or EventID=528 or EventID=544 or EventID=545 or EventID=546 or EventID=561 or EventID=564 or EventID=612)]]</Select>
<Select Path="Microsoft-Windows-Backup">[System[Provider[@Name='Microsoft-Windows-Backup'] and (EventID=5 or EventID=8 or EventID=9 or EventID=17 or EventID=22 or EventID=49 or EventID=50 or EventID=52 or EventID=100 or EventID=517 or EventID=518 or EventID=521 or EventID=527 or EventID=528 or EventID=544 or EventID=545 or EventID=546 or EventID=561 or EventID=564 or EventID=612)]]</Select>
</Query>
</QueryList>
 
b. Set the Action to run the batch file you created earlier.
 
5. Test the task by right clicking on it and running it manually.

Backup Success Email
Repete the above steps but use this for the batch file:

sendEmail -f [email protected] -t [email protected] -cc [email protected] -u “TechShizz – HVEXCHANGE2016 Full Backup Success” -m Event ID 4 For Windows Server Backup has been logged:The backup operation has finished successfully. -s <serverIP> -xu SMTP_username -xp userpassword

Post navigation

❮ Previous Post: How to clear a print queue that won’t clear
Next Post: How to disable SIP ALG on a Draytek router ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Subscribe to our newsletter!

Recent Posts

  • How to implement a lightning-fast ransomware playbook
  • How to achieve defence in depth in your business
  • How to implement a SecOps team phishing response plan
  • How to block an Office 365 Sign-in correctly
  • Microsoft finally patched serious Exchange 0-day over a month old!

Recent Comments

    Archives

    • November 2022
    • July 2021
    • March 2021
    • February 2021

    Categories

    • Cyber Security
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Copyright © 2023 .

    Theme: Oceanly News Dark by ScriptsTown