Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

How can I read the property's "Description" of a security Log's entry in the Evnet Viewer?

I'm using vs2005 C#, .net 2.0 on Windows 2000 server.
When I double click on an entry of the "Security" log in the system's "Event Viewer", a Property window pops up.  In this window, there is a "Description" section that lists many different information like "User Name:, "Domain", "Login ID"......
How can I obtain each of this inforation in my program?  Thank you.

SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca
lapucca

ASKER

Hi sirbounty,

Your link downloads a vbscript program.  I don't know hot to read that.  Thanks.
Here is a quick overview of his vbscript:

Enter the path to the security log you wish to read
Calls the ReadSecLog Function and It reads the entire log and stores it in sParsedSecLog
Enter the path of the output file for the parsed security log
Calls the WriteToFile Function which writes the parsed security log to your output file specified

Avatar of lapucca

ASKER

I need to get the description filed and parse it so that exe won't work.  Thanks.
WMI is the way to go, do you require more specific links or instructions on accessing WMI via C, .Net?
-rich
Avatar of lapucca

ASKER

Thanks everyone.  In C# I can retreive an entrylog's message, which I had to parse to get each of the key item.