Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Exporting partial Event Log as .evt file

Reply
 
Old 09-14-2009   #1 (permalink)
darmstrong


 
 

Exporting partial Event Log as .evt file

My first problem got solved - couldn't get
"Win32_NTEventLogFile.BackupEventLog(path)" to work. Urkec pointed out that
when connecting to a remote computer, WMI methods often can only write to a
local path on that remote computer.

Now I'm trying to figure out how to get a partial ".evt" file export,
instead of exporting the entire log.

For example, the following code exports the entire application log:

Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile " _
& "Where LogFileName='Application'")
For Each objLogfile in colLogFiles
errBackupLog = objLogFile.BackupEventLog( _
remoteWMIpath & "EventLog.evt")

.. . . but what if I want to retrieve only the last month's worth of entries?

The "Win32_NTLogEvent" class facilitates qualification of each log event by
date. Once a log event is qualified, however, it doesn't appear to me that
there's a straight-forward way to export individually-qualified log events
into a .evt file, such that the end result is formatted the same way it would
have been with the Win32_NTEventLogFile.BackupEventLog class/method.

Is there a simple way to get a partial date range exported as a "standard"
..evt file, without having to manually contruct each exported event? (assuming
that such a manual contruct 's even possible)

Thanks,

David

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Exporting Outlook CSV file to Windows Mail Microsoft Office
Exporting an Excel file Vista General
Search partial file name Vista file management
exporting results/text of powershell script to a file as it is run PowerShell
Exporting an object to a csv file PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46