Announcement

Collapse
No announcement yet.

Setting up email notification for specific events in the Event Viewer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting up email notification for specific events in the Event Viewer

    Hi All,

    We are using Windows 2003 R2 in an Active Directory environment. We are not using any monitoring tools like MOM or SMS.

    Does anyone know a way to setup up email notification for specific events in the Windows Event Viewer? Do you know of (and work with) any free third-party software offering this functionality in case Windows itself does not offer it?

    Thx in advance for any helpful comments.

    Br, Jerry

  • #2
    Re: Setting up email notification for specific events in the Event Viewer

    Hi,

    You can do that by using Eventtriggers.exe and a VBS script for sending the e-mail notification.
    What you do is open Notepad and copy and paste the following code and save it as e-mail.vbs in C:\ :

    Code:
    Set objEmail = CreateObject("CDO.Message")
    
    objEmail.From = "[email protected]"
    objEmail.To = "[email protected]"
    objEmail.Subject = "Subject" 
    objEmail.Textbody = "Text body"
    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
            "Your SMTP Server" 
    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    objEmail.Configuration.Fields.Update
    objEmail.Send
    Make sure you customise the sections in Bold within the code.

    Then use the Eventtriggers.exe to create a new trigger as the example below:
    Code:
    Eventtriggers /Create  /TR "Event Triggers for AD Account Changes" /EID "642" /T "Success Audit" /TK C:\E-mail.vbs
    You can run the above on the server you want the Eventtriger.
    Check Eventtriggers /? for more info.

    Thanks
    Caesar's cipher - 3

    ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

    SFX JNRS FC U6 MNGR

    Comment


    • #3
      Re: Setting up email notification for specific events in the Event Viewer

      Thx. Will try it out.

      Br, Jerry

      Comment


      • #4
        Re: Setting up email notification for specific events in the Event Viewer

        Now i even found a Howto here on Petri

        In case someone looked for it and did not find it like myself -> http://www.petri.com/how-to-use-even...-event-ids.htm

        Comment


        • #5
          Re: Setting up email notification for specific events in the Event Viewer

          Yeah, that's a good and thorough article from Daniel.
          Same principle, uses eventtriggers.exe and Bmail.exe instead of the VBS script I suggested for sending e-mails.
          The outcome is the same.

          Cheers
          Caesar's cipher - 3

          ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

          SFX JNRS FC U6 MNGR

          Comment


          • #6
            Re: Setting up email notification for specific events in the Event Viewer

            Thanks for this guys and since i am still new to Vb scripting can you tell me a way to tell the script not to send addtional emails for the same event if it happens like 5 seconds afterwards.

            I have already been alerted and the program has sent the email to me but to get the same email again and again is like spam, so can u define an interval as to how the notifications are sent??

            -Ali

            Comment


            • #7
              Re: Setting up email notification for specific events in the Event Viewer

              I don't think it's possible using this method. Although the e-mail is sent by the VBS script, it's the job of the Eventtriggers.exe to send call the VBS script and send the e-mail eventualy.
              Once you create an Eventtrigger then, you'll get all the notifications based on that event when the it's logged because there is no parameters of the eventtrigger to set let's say a "Time Limit".
              That's why triggers need to be planned well, so you only get notifications for critical events that do not occurr that often (Ie. not logon/logoff Events).

              Cheers
              Caesar's cipher - 3

              ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

              SFX JNRS FC U6 MNGR

              Comment


              • #8
                Re: Setting up email notification for specific events in the Event Viewer

                If eventtriggers.exe calls the VBS script, can the VBS script not write events to a text file and query this file for a match before sending the email? If it finds a matching event it knows not to send an email.

                You may need to empty this file from time to time to stop it getting too big.

                Comment

                Working...
                X