melnib00ne Posted November 9, 2007 Posted November 9, 2007 Hello,anyone to has or help me to scripting an batch or vb-script to export the windows eventlogs to year-month-date.log file or an csv ?thanks,/krMelnib00ne
melnib00ne Posted November 9, 2007 Author Posted November 9, 2007 done. i've found an solution by this way:dtmThisDay = Day(Date)dtmThisMonth = Month(Date)dtmThisYear = Year(Date)strBackupName = dtmThisYear & "_" & dtmThisMonth & "_" & dtmThisDaystrComputer = "."Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Backup)}!\\" & _ strComputer & "\root\cimv2")Set colLogFiles = objWMIService.ExecQuery _ ("Select * from Win32_NTEventLogFile where LogFileName='Application'")For Each objLogfile in colLogFiles objLogFile.BackupEventLog("c:\scripts\" & strBackupName & _ "_application.evt") objLogFile.ClearEventLog()Next
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now