Solved

Windows Backup and Task Scheduler

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

746 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

11 Experts available now in Live!

Get 1:1 Help Now