Solved

Windows Backup and Task Scheduler

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
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 …

707 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