Script for emailing ntbackup log files

Scripts for ISA Server


Script to e-mail the output of any chosen command, such as “ipconfig /all”, when the script is executed by an ISA Server alert action, scheduled job, EventTriggers.exe, Performance Monitor alert, etc. Unlike ISA Server e-mail alerts, you can specify a username and password, and use SSL for SMTPS. Especially nice for being alerted when DHCP-assigned IP addresses change.

I do not know how I found this site but this script inspired me to improve my ntbackup reporting. The standard SBS reporting is pretty good for SBS full backup jobs. The problem occurs if you have gotten a little more sophisticated in your backup strategy. I am using an incremental daily backup job in conjunction with a weekly full backup. For my small site this combination of full and incremental backups allows me to go back and restore a file for up to thirty days. The really nice thing about this strategy is that it fits on a relatively inexpensive 250 MB USB disk drive.

  1. My first step was to modify the script to find the last backup log file and include it in the email.
  2. My second step was to put in a different subject if the backup was successful, failed or was not run. My logic works off of the size of the backup log. It is not perfect but it will work until I find something better.

I schedule this as a job to be run a couple of hours after the backup should be complete. So far the email looks pretty good but I still have one more improvement. The 8019 event ID is posted when ntbackup finishes. It posts either an information type event if ntbackup is a success and an error type event if it fails. I will create two eventtriggers based on these events to write out a small text file I will use to write out the subject line of the email. I cannot use these triggers to email the log since the verify is not complete and log file is still open. Unfortunately ntbackup does not post a unique event ID for when the verify is complete so I will continue to schedule the job and look at the email in the morning.