Solved

Windows Backup and Task Scheduler

Posted on 2010-08-18
5
2,204 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-
  • 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 500 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

785 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