Issue reading 'Security' EventLog entries for Standard user Privileges on Windows 7 RRS feed

  • Question

  •  Hi All,

    I am trying to read the Windows Security Event log by notification in C# application.

    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'. when i execute the line
    _eventlog.EnableRisingEvents = True;
    I tried adding the user to the windows local 'Event Log Readers' Group but that did not help.

    Note: I run this application with local administrator rights it works fine.

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

    Please guide for the same.

    Wednesday, December 14, 2011 1:24 PM