I am creating a robot to read through old event logs and I am unable read from any event log except the Windows default application, security, and system. Why? Can this be done with VBscript?
one would hope you could use
Win32_NTLogEvent.Logfile
and specify the path to the .evt file.
i am presuming they are savedin .evt format.
never tried it though.
what format are the .evt files if you open then as a textstream? i cant believe there isnt a parser from M$ to do this is .LogFile doesnt work
It may be that I just haven't found the parser and it does exist. Here is the code that I am using. The file EtormFS.evt is a system event log from another computer named Etormfs. Thank you for all of your responses.
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'ETORMFS'")
For Each objEvent in colLoggedEvents
if objEvent.SourceName = "Double-Take" then
Wscript.Echo "Category: " & objEvent.Category & objEvent.ComputerName & objEvent.EventCode & objEvent.Message & objEvent.RecordNumber & objEvent.SourceName & objEvent.TimeWritten & objEvent.Type & objEvent.User
end if
Next
seems strange you cant do it the method you have shown.
you might want to try LogParser.msi, from M$ apparently it can read eventlogs, not sure if that is ones taht have been saved.
only other fudge i can think of is to
1. copy your Application logfile sideways
2. rename your ETOR evt file to what the Application one was
3. read the applucation log
4. copy your application log back again
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.