Windows Server 2008 Backup Email notifications?

Discussion in 'Windows Server' started by ja, Oct 21, 2009.

  1. ja

    ja Guest

    I know this is an elusive request, but has anyone had any luck in getting
    WSB2008 to send a simple "Backup was Successful" or "Backup Failed" email
    message?

    If I log into the Server 2008 Manager console, click Storage/Windows Server
    Backup, the Status screen shows the following messages:

    Time Message Description
    --------------------------- --------------- -------------------
    10/20/2009 11:00 PM Backup Successful
    10/19/2009 11:00 PM Backup Successful
    10/18/2009 11:00 PM Backup Successful

    Question: How do I forward these messages out to my Email each day?

    Question 2: I have this 2008 server as part of a SBS2003 domain. Is there a
    way to have SBS2003 grab the Event Logs from 2008, and then have SBS2003 send
    them out in the daily Performance Report?

    These links seem to say it is possible to send an email via 2008 (but I'm
    not sure how to set it up):
    -------------------------------------------
    -
    http://www.experts-exchange.com/OS/...ms/Server/Windows_Server_2008/Q_24132737.html

    -
    http://social.technet.microsoft.com...p/thread/bcd72564-5763-4390-8626-bf3ecdea9d63

    - https://www.help4it.co.uk/component/content/article/56/226.html
     
    ja, Oct 21, 2009
    #1
    1. Advertisements

  2. ja

    Eric Guest

     
    Eric, Nov 6, 2009
    #2
    1. Advertisements

  3. Question 2: You could use the VB Script below to extract events from your
    Windows 2008 machine:
    '--------------------------------------------------
    'Extract events from a local or remote event logger
    '--------------------------------------------------
    Const Computer = "MyServer"

    StartDate = "'20090901'" 'YYYYMMDD
    EndDate = "'20091105'" 'YYYYMMDD
    Branch = "'System'" 'Application, Security or System

    Set ObjWMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
    Set colEvents = ObjWMIService.ExecQuery _
    ("Select * from Win32_NTLogEvent " _
    & "Where Logfile = " & Branch _
    & " and TimeWritten >= " & StartDate _
    & " and TimeWritten <= " & EndDate)

    For Each Item In colEvents
    WScript.echo Item.EventCode, Item.EventIdentifier, Item.Message,
    Item.timewritten
    Next
    WScript.Echo (colEvents.Count & " events found.")

    The script is easily tailored to suit your specific needs, e.g. which events
    you wish to extract or which fields you wish to include in your report. You
    should invoke it like so:

    cscript //nologo c:\Event.vbs > c:\Event.txt

    To send the file by EMail you could use this script:
    const cdoBasic=1
    schema = "http://schemas.microsoft.com/cdo/configuration/"
    Set objEmail = CreateObject("CDO.Message")
    With objEmail
    .From = ""
    .To = ""
    .Subject = "Events for " & date
    .Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog"
    .AddAttachment "c:\Event.txt"
    with .Configuration.Fields
    .Item (schema & "sendusing") = 2
    .Item (schema & "smtpserver") = "mail.company.com"
    .Item (schema & "smtpserverport") = 25
    .Item (schema & "smtpauthenticate") = cdoBasic
    .Item (schema & "sendusername") = ""
    .Item (schema & "smtpaccountname") = ""
    .Item (schema & "sendpassword") = "SomePassword"
    End With
    .Configuration.Fields.Update
    .Send
    End With

    To keep things nicely structured you would make the two scripts subroutines
    of one single script. Note that I have tested both scripts on various
    servers but not yet on Windows 2008.
     
    Pegasus [MVP], Nov 6, 2009
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.