?
Solved

Windows Backup and Task Scheduler

Posted on 2010-08-18
5
Medium Priority
?
2,238 Views
Last Modified: 2012-05-10
Hi,

I'm currently backuping up about 10 users PCs after installing new drives. By doing so anything on the new drives would need to be backed up onto the C drive. This works fine as i find windows backup to be quite a good local backup utility, but my dilemma stands at producing an email to be sent to our backup mailbox upon failure.

I have attempted to use Task Scheduler to send an email although i keep recieving a Run Failure.

So far i have set up Task Scheduler to send an email When a specific event is logged"  followed by "Log - Application", "Source - Backup" and "Event ID - 521".

I then fill the space, From, To, Subject, Text and SMTP server.

This seems simple enough although when i tested this through other event IDs, to see if it would work recieve the Run Failure - Task Scheduler failed to complete task "\Test" , instance "{98990505-bff7-4192-96cd-e1baf770ba81}" , action "Test Email" . Additional Data: Error Value: 2147746323.

I know that i am inputting the correct details and port 25 is open on the SMTP server.

I'm currently stumped at how i can achieve to send an email after windows backup failure.


Note: Event ID 521 for Backup produces the error Backup started at '%1' failed as Volume Shadow copy operation failed for backup volumes with following error code '%2'. Please rerun backup once issue is resolved.

Cheers.
0
Comment
Question by:pps-
[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
  • 2
5 Comments
 
LVL 5

Expert Comment

by:sosinc3
ID: 33471034
Is SMTP relaying allowed on your SMTP server and/or does it require user authentication in order to relay?
0
 

Author Comment

by:pps-
ID: 33471092
we allow SMTP relay from certain hosts and we do not require user authentication in order to relay
0
 
LVL 30

Accepted Solution

by:
Brad Howe earned 2000 total points
ID: 33471094
Hi,

I created the same task as well. Save this as task.xml, open Task Scheduler, Right click Import and browse to the task.xml.
Change eventID to 4 for successful backups and 5 for failed backups. As well, change the hightlighted settings to something that makes sense.

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2010-07-27T09:02:30.2065391</Date>
    <Author>SERVERNAME\User.Account</Author>
    <Description>Send Notification email on Failed Server Backup</Description>
  </RegistrationInfo>
  <Triggers>
    <EventTrigger>
      <Enabled>true</Enabled>
      <Subscription><QueryList><Query Id="0" Path="Microsoft-Windows-Backup"><Select Path="Microsoft-Windows-Backup">*[System[Provider[@Name='Microsoft-Windows-Backup'] and EventID=5]]</Select></Query></QueryList></Subscription>
    </EventTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>SERVERNAME\ServiceAccount</UserId>
      <LogonType>S4U</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <SendEmail>
      <Server>smtp.mailserver.com</Server>
      <Subject>FAILED - Backup of SERVERNAME</Subject>
      <To>youraccount@domain.com</To>
      <From>Monitoring@server.com</From>
      <Body>Please jump on SERVERNAME and review event logs and Windows server Backup logs for more details.</Body>
      <HeaderFields />
    </SendEmail>
  </Actions>
</Task>  
Cheers,
Hades666
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33471104
You can also verify SMTP is correct.

Open CMD
Type "telnet mail.smtp.com 25"

If it responds you can send an email out by issuing the commands...

MAIL FROM:servername@domain.com
RCPT TO:you@domain.com
DATA
This is a test.
.
QUIT

If you receive this, SMTP is working properly. If you get any error codes, please let us know.

cheers,
Hades666

0
 

Author Closing Comment

by:pps-
ID: 33471118
Brilliant Work to the Experts!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 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