Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to read the Windows Security Event log by notification.

Below is sample line of code, but when I run it on Windows 7 with a standard user I get an Exception:

EventLog _eventlog = new EventLog("Security"); //Monitor on the Security events 
_eventlog.EntryWritten += new EntryWrittenEventHandler(OnSecurityEventLogWritten);
_eventlog.EnableRisingEvents = True; // I get an exception at this line with a Windows 7 standard user

I am getting the exception saying Requested Registry is not allowed. I tried adding the user to the Event Log Readers Group but that did not help.

It's important to note that when I run this application with local admin rights it works fine.

My requirement is to get the notification when Windows Security events and written for a standard login user.

share|improve this question
    
That looks like C#, but you should probably make it clear what language you are using. –  Ben Pilbrow Dec 6 '11 at 20:05
    
I am using C# language. As mentioned in above code sample , C# has option to get notification when Security event entry is happened. Only issue is standard user gives exeception. Any idea. –  Vivek Dec 7 '11 at 1:02
    
Guys , Any idea to solve this issue. –  Vivek Dec 7 '11 at 8:36
add comment

2 Answers

to read security events on windows 7, add network service account to event log readers group.

share|improve this answer
add comment

Adding a user to the "Event Log Readers" group should work, at least according to Microsoft. Did you log the user off and back on? Keep in mind that group membership changes require a user to logon and logoff before it will work.

Please also keep in mind that giving a regular user access to the security event log might open your network up to attacks.

Finally, you should take a look at these articles, they explain how to apply custom permissions to event logs:

http://technet.microsoft.com/en-us/library/cc722385%28WS.10%29.aspx

http://blogs.technet.com/b/janelewis/archive/2010/04/30/giving-non-administrators-permission-to-read-event-logs-windows-2003-and-windows-2008.aspx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.