$smtpServer: SMTP Server FQDN.
$msg.subject: Add a meaningful subject.
$bodyText: Email Message.
$msg.To.Add : Recipient email address / DL (For multiple email addresses add multiple lines of $msg.To.Add)
$smtpServer = <
SMTP
Server Name>
#Creating a Mail object
$msg = new-object Net.Mail.MailMessage
#Creating SMTP server object
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
#Email structure
$msg.From = DC.Subhro.Com # Server Name where backup job is successful
$msg.To.Add("Recipient Email-address/ DL")
$msg.To.Add("Reciient Email-address / DL")
$msg.subject = "AD Backup Success Report: Subhro.com Domain"
$msg.body = $bodyText
#Sending email
$smtp.Send($msg)
#############################################################
$msg.From = DC.Subhro.Com # Server Name where backup job has failed
$msg.subject = "AD Backup FAILURE Report: Subhro.com Domain"
#######################################################################
Most of the steps are similar to what you have done in backup success configuration. So you can export that task and import it with a different name, like: AD Backup Failure Notification. The only section which you need to modify is “Triggers”. Please perform below steps: • Begin the Task: On an event • Select “Custom” and click “New Event Filter”. • Select By Log : Microsoft-Windows-Backup/Operational • Include / Exclude Events : -4,-14,-1 • Click OK. Putting a minus (-) sign would exclude events 4,14 and 1.