Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Back Up and Clear Large Event LogsContent of Back Up and Clear Large Event Logs.vbsMD5 Hash: 5B6C529B95C1D0CF9F6AFB79D0CF566A |
||
' Description: Backs up and clears an event log if the log file size is larger than 20 megabytes.
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate, (Backup, Security)}!\\" _ & strComputer & "\root\cimv2") Set colLogFiles = objWMIService.ExecQuery _ ("Select * from Win32_NTEventLogFile") For Each objLogfile in colLogFiles If objLogFile.FileSize > 100000 Then strBackupLog = objLogFile.BackupEventLog _ ("c:\scripts\" & objLogFile.LogFileName & ".evt") objLogFile.ClearEventLog() End If Next | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |