Historical Post Series – Auto-eject Script and Email Alert for SBS 2003 Tape Backup

The Historical Post Series are writings I produced in my former blog on Live Spaces and due their value are being reposted here.  Hope you enjoy these.

auto-eject script and email alert for SBS tape backup

originally posted October 2006

I created a folder C:batch then inside it a 5633.vbs file with the following contents:

‘begin code
On Error Resume Next
Set objShell = WScript.CreateObject("WScript.Shell")
strCommand = "rsm eject /LGA2A90879A1994371BDE6D8713FF2061C /astart"
Set objWshScriptExec = objShell.Exec(strCommand)
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "SBS Backup – Completed Successfully"
objMessage.From = "administrator@sourcedomain.com"
objMessage.To = "me@mainaddy.com"
objMessage.Cc = "metoo@altaddy.net"
objMessage.TextBody = "SBS Backup Succeeded"
objMessage.Send
‘end code

This VBS script uses both the RSM command which you can explore for more information on the switch options.  Initially I tried using various switches and ended up having to learn how to identify and then use the GUID of the Library used.  The GUID in red is unique to this library and you would of course have to modify this to suit your specific situation whether a library, drive, …etc.

The next step uses this script using the "eventtriggers" command.  Under the context of what I’ve created above you would then on one line at a command prompt enter the following exactly:

eventtriggers /create /tr SBSBackupSuccess /eid 5633 /t INFORMATION /tk "c:batch5633.vbs" /ru "System"

Event 5633 is for a successful backup and complements event 5634 for a failed backup.  SBS has a built in alert for event 5634 but no provision for a successful backup.

Go into the Health and Monitoring Console and see how this has been added and how this now works.  It will intuitively explain a lot of what the SBS alert wizard sets up and how to go outside that box.

**Credit and much thanks given to Bob Haley and Marina Roos for their large contributions.**

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s