?
Solved

Windows Backup Email Notifications - Server 2012 R2 Standard

Posted on 2014-04-01
2
Medium Priority
?
7,911 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 total points
ID: 39969244
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is comprised of the pearls we have garnered deploying virtualization solutions since Virtual Server 2005 and subsequent 2008 RTM+ Hyper-V in standalone and clustered environments.
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Suggested Courses

762 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