How to read Security Logs from Domain Controllers using C#?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dkm234
    New Member
    • May 2007
    • 2

    How to read Security Logs from Domain Controllers using C#?

    I am trying to read Account Management category events of Security Logs using EventLog class, but I can not read the event message. Error message:

    "The description for Event ID '565' in Source 'Security' cannot be found. The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them."

    Any suggestion?


    Also is it possible to read event log from Domain Controllers in real time using C# (or .Net)...if yes how?


    Regards!
  • oohay251
    New Member
    • May 2007
    • 27

    #2
    read the ms article KB842795 and then "Introducti on to the EventLog Component" in your .Net documentation

    Comment

    • dkm234
      New Member
      • May 2007
      • 2

      #3
      Hi,


      Can you explain in detail? Article KB 842795 is about custom event and I am not dealing with custom events......... ..

      Thanks!

      Comment

      • oohay251
        New Member
        • May 2007
        • 27

        #4
        Read that introductory material.

        using System.Diagnost ics;
        static class ShowEventLog
        {
        static void Main()
        {
        NegotiateStream ns = new NegotiateStream (new System.IO.
        EventLog el = new EventLog("Appli cation","192.16 8.1.101");
        foreach (EventLogEntry ele in el.Entries)
        {
        Console.WriteLi ne(ele.TimeWrit ten);
        Console.WriteLi ne(ele.Message) ;
        }
        }
        }

        Comment

        Working...