Re: Is there a way to query Security Event Log with Filter in C#?



Hi Pucca,

I currently prcoess each Security Log
entry one by one to extract those that fit the selection criteria. Is
there
a function that I can use to query the entries with option of filtering
for
certain event id and/or time period in C#?

I'm afraid no such function/feature exists in .NET 2.0, but it shouldn't be
too difficult to write your own filtering when you loop through the entries
in the log using the Entries property. Here's a basic "how to" article on
different things you can do with event logs:

http://support.microsoft.com/kb/815314

Also, you might wish to enable notifications when new entries are written to
the event log, and then filter the events there (if applicable to your
solution). See the Receive Event Notifications section in the above article.

Thanks!

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
janij@xxxxxxxxxxxxxxxxxxxxxx
http://www.saunalahti.fi/janij/


.



Relevant Pages

  • Re: filtering list of data
    ... An AutoFilter dropdown list will only show 1000 entries. ... has more than 1000 unique items, they can be filtered, but they can't ... > columns are invoice #, invoice date, customer name, and invoice amount. ... > recently learned about filtering which comes in way more handy that the ...
    (microsoft.public.excel.misc)
  • Re: HEADSUP: arp-v2 has been committed
    ... obtains the entire L3 table and filtering for RTF_GATEWAY ... I'd love to see this addressed in Wine 1.1.12. ... to retrieve the L2 entries a bit odd. ... again both backwards and with other operating systems. ...
    (freebsd-current)
  • Re: HEADSUP: arp-v2 has been committed
    ... obtains the entire L3 table and filtering for RTF_GATEWAY ... I'd love to see this addressed in Wine 1.1.12. ... to retrieve the L2 entries a bit odd. ... again both backwards and with other operating systems. ...
    (freebsd-net)
  • RE: Can one form contain another as a control?
    ... > I have an edit form to be used when adding new entries. ... > have filtering text & combo boxes along the top, a TreeView control along the ... > I could probably come close using an MDI, but I already have an MDI form ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Event View Security logs
    ... I guess my concern would be that with so many entries it would be very easy ... But I guess filtering would take care of ... default maximum retention size of the event logs: ...
    (microsoft.public.windows.server.sbs)