Solved

Windows Backup Email Notifications - Server 2012 R2 Standard

Posted on 2014-04-01
2
7,623 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 500 total points
ID: 39969244
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

730 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