melnib00ne Posted November 9, 2007 Share 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 Link to comment Share on other sites More sharing options...
melnib00ne Posted November 9, 2007 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now