Options

NTbackup with email notification?

nelnel Member Posts: 2,859 ■□□□□□□□□□
Does anyone have email notification when using ntbackup setup? i know its not built into ntbackup but know there are scripts about. does anyone use this setup?

cheers
Xbox Live: Bring It On

Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking

Comments

  • Options
    sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    Modify this code with the appropriate entries for your email address/server and save it as a .vbs file. Then use the "call" statement within your backup batch file.

    SMTPServer = "smtphost.domain.com"
    Recipient = "you@yours.com"
    From = "me@mine.com"
    Subject = "Test email"
    Message = "This is a two line test message" & vbcrlf & "Did you get it?" 
    
    ' To add an attachment update the full path and uncomment the line
    ' There is one line below that must also be uncommented
    
    
    'attachment = "c: \ test.txt"
    
    
    GenericSendmail SMTPserver, From, Recipient, Subject, Message
    
    Sub GenericSendmail (SMTPserver, From, Recipient, Subject, Message) 
    
    set msg = WScript.CreateObject("CDO.Message")
    msg.From = From
    msg.To = Recipient
    msg.Subject = Subject
    msg.TextBody = Message
    
    ' To add an attachment uncomment this line
    'msg.AddAttachment attachment
    
    msg.Configuration.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
    msg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    
    msg.Configuration.Fields.Update
    
    msg.Send
    

    So if you use the at or schtasks for your backups, put them into a batch file and then use call statement to run this with cscript. You can pipe output from the other commands into a text file to then attach to this email script by uncommenting the appropraite lines.
    All things are possible, only believe.
Sign In or Register to comment.