Link to home
Start Free TrialLog in
Avatar of mbkitmgr
mbkitmgrFlag for Australia

asked on

Collect Error code from Windows Server Backup

Has anyone any knowledge of a way to pass error codes from a Windows Server Backup in Server 2012/16/19 to a batch file.

Scenario - for sites that just want to run Windows Server Backup as their only backup method, I have a batch of XML files I import into Server 2008R2 Task Scheduler.  These file contain a list of responses to Return Codes from Windows server backup and email me + the client the details
e.g.
  • When an unrecognised drive is attached error 561 is generated in the event log
  • Task Schediuler generates an emai warning me they have used the wrong drive
I have ones covering things like low disks space, backup succeed, backup fail, no drive connected.....

With Server 2012 and 2016 I can generate the emails easily enough but want to pass the error code to the batch/script, so that the subject and body of the email is generated based on the error code.\

Have spent a few hours playing with various variable from the OS but cant find it...any clues
ASKER CERTIFIED SOLUTION
Avatar of Michael B. Smith
Michael B. Smith
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please clarify... How are your existing
Task Scheduler tasks currently getting the Codes from Windows server backup?
Avatar of mbkitmgr

ASKER

I was attaching tasks to events from event log.

In the end I've written a batch file that will asses any response in the event log from Backup and generate an email to clarify what the issue is