Solved

Windows Backup Email Notifications - Server 2012 R2 Standard

Posted on 2014-04-01
2
7,286 Views
Last Modified: 2014-04-10
I have a server running Server 2012 R2 Standard.  I'm attempting to configure an email alert for when the backup completes or fails.  This used to work on Server 2012 (None R2) but for some reason it was removed in R2.  I was able to trigger an email based on a event log but can't complete this anymore.  I created a powershell script that isn't working as well as I believe it was designed for none R2.

This server is running Exchange 2013 and can relay off itself if needed.

Here is the script I've configured to run.

###############################################################
# Receive_Mail_Notification_If_Last_Windows_Server_Backup_Fails_v1.0.ps1
# input : n/a
# output : none (logs)
# Version 0.1
# Changelog : n/a
# MALEK Ahmed - 12 / 01 / 2013
###################

##################
#--------Main  
##################

$Sender = "Backup@domain.com"
$Receiver="personthatcheckstheback@domain.com"
$smtpServer = "Emailserver"

##################
#--------Main  
##################

$backup = Get-WBSummary
$backup.LastBackupResultHR
if ($backup.LastBackupResultHR -ne 1)
{
    #Mail Notification about errors
        $mailbody = "The Last Backup launched on " + (get-item env:computername).Value + " Completed Successfully.`r`n`r`n"
        $mailbody += $backup.DetailedMessage
        $msg = new-object Net.Mail.MailMessage
        $smtp = new-object Net.Mail.SmtpClient($smtpServer)
        $msg.From = $Sender
        $msg.To.Add($Receiver)
        $msg.Subject = "[SUCCESSFUL] The Last Backup launched on " + (get-item env:computername).Value + " Completed"
        $msg.Body = $mailbody
        $smtp.Send($msg)        
}
0
Comment
Question by:excaltech
2 Comments
 
LVL 13

Expert Comment

by:Santosh Gupta
ID: 39969131
Hi,

not sure about power shell issue, but if you want you can use task scheduler to send the email notification.

sch
hope it will help you.
0
 
LVL 17

Accepted Solution

by:
Brad Bouchard earned 500 total points
ID: 39969244
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Resolve DNS query failed errors for Exchange
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now