473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

2
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!
May 24 '07 #1
3 2359
read the ms article KB842795 and then "Introduction to the EventLog Component" in your .Net documentation
May 25 '07 #2
dkm234
2
Hi,


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

Thanks!
May 29 '07 #3
Read that introductory material.

using System.Diagnostics;
static class ShowEventLog
{
static void Main()
{
NegotiateStream ns = new NegotiateStream(new System.IO.
EventLog el = new EventLog("Application","192.168.1.101");
foreach (EventLogEntry ele in el.Entries)
{
Console.WriteLine(ele.TimeWritten);
Console.WriteLine(ele.Message);
}
}
}
May 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
11
by: Jason | last post by:
I'm trying to implement role-based security in my ASP.NET application, however, everytime I perform an IsInRole check, it ALWAYS returns false! My Web.Config file has the following entry: ...
3
by: =?Utf-8?B?Q0QuU21hbGxleQ==?= | last post by:
Is there a command line switch available for the EventViewer which will allow me to specify which directory to view the available logs from? I will have multiple workstations writing to a...
0
by: =?Utf-8?B?U2FtZWVrc2hh?= | last post by:
Not sure which newsgroup this question should go to. I want to find out, using .net c# code whether a domain controller on the given machine is read only. The logic I am using is as follows -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.