How to gather event logs from all PCs on a domain to centrally filter/review

How can I gather event logs from all PCs on a domain to centrally filter/review?  I would ideally like to do this through VBS or some freeware program.  Any ideas?
LVL 2
TASINetworkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

amit_gCommented:
You need to run the script as domain-administrator if you want to access other computers. The parameter to ExecQuery is like any SQL statment. The table definition can be found in

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_ntlogevent.asp

This particular example will list all System events that are Error.

strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery("Select * from Win32_NTLogEvent Where Logfile = 'System' and EventCode = 1")
For Each objEvent in colLoggedEvents
    Wscript.Echo "Category: " & objEvent.Category & VBNewLine _
    & "Computer Name: " & objEvent.ComputerName & VBNewLine _
    & "Event Code: " & objEvent.EventCode & VBNewLine _
    & "Message: " & objEvent.Message & VBNewLine _
    & "Record Number: " & objEvent.RecordNumber & VBNewLine _
    & "Source Name: " & objEvent.SourceName & VBNewLine _
    & "Time Written: " & objEvent.TimeWritten & VBNewLine _
    & "Event Type: " & objEvent.Type & VBNewLine _
    & "User: " & objEvent.User
Next

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TASINetworkAuthor Commented:
This looks good, but I don't get the Message part.  It comes says the message is something like:

17/12/2005 21:26   Connection received from 192.168.122.63

How can I get the real Description?  I also need the Source too.  I basically want everything that you see when you manually open the event in the event view (plus the computer name of course).
grayeCommented:
You can use the Dumpel command from the Resource Kit to pull remote event logs into a CSV file.   You can then import the CSV file into Excel or Access and do further filtering... write queries... do reports, etc

http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/dumpel-o.asp
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

amit_gCommented:
How are you executing this? Open command prompt and run

cscript YourVBSFile.vbs
sr75Commented:
The best option is to use winlogd on each system that converts the windows event log to syslog and have it sent to a syslog server.

You can get it here:

http://www.edoceo.com/products/winlogd.php

You can get a syslog server for Windows from Kiwi.  It is free as well.

Sorry no VBS solution.
TASINetworkAuthor Commented:
amit_g:  the message that I put is only part of the message.  Here is an actual output:

Record Number: 3011
Source Name: Program
Time Written: 20051219161750.000000-300
Event Type: information
User:
Category: 1
Computer Name: MyPC
Event Code: 1
Message:
19/12/2005 14:08   Connection received from 192.168.1.5

As you can see, everything looks ok, except for the Message section.
TASINetworkAuthor Commented:
sr75:  I'll test out that method.  It's not optimal for my situation, but it could be a fallback solution.  I'm hoping to read in all events  at a particular time rather than receive each event (I'm really hoping to not have to install somthing on each PC, and if so, it would have to be able to be installed through a GPO or something simple in bulk).

navstar16:  Those are both for writing to the event log, not reading it.
amit_gCommented:
That must be the actual description. Check the event log for exact details. The query should be

...Logfile = 'Application' and Category = 0

for error messages.
TASINetworkAuthor Commented:
Actually, I was just checking and it IS the description.
TASINetworkAuthor Commented:
I've got it working now thanks to amit_g!  Just have one last bug to squash in it, but that is for another question.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.