Solved

Query Event Log for errors by source

Posted on 2012-03-24
2
375 Views
Last Modified: 2012-03-26
Hi,

I am using C#4.0 and Windows Server 2008

I need to query the Application event log.

I  need to query like this:

Give me all events where Source = "x" and where Created Date >= "my date"

Also the event log may be on a different machine.  

Can anyone help please?

Thanks very much
0
Comment
Question by:MrKevorkian
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 37762699
I would use WMI and execute a query against Win32_NTLogEvent.

Win32_NTLogEvent class
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394226(v=vs.85).aspx

Example query:

Select * from Win32_NTLogEvent Where Logfile  = 'Application' and SourceName like '%Backup%'"
0
 
LVL 1

Author Comment

by:MrKevorkian
ID: 37764778
thanks just having a look at this now.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question