Bize Ulaşın / Contact Us

Script ile Event Log’u boyutuna gore yedeklemek ve temizlemek

04 / 03 / 2011 by Uncategorized Yorum yok / No Comments

Asagidaki ornek script araciligi ile Event Log’unuzu sizin belirleyeceginiz boyutu gecmesi durumunda yedeklemek ve temizlemek icin kullanabilirsiniz, ornekteki boyut kriteri 20MB icin verilmistir. Script Security log disindaki loglar icin calisacak sekilde yazilmistir, ayrinti icin bu linki incelemenizi tavsiye ederim.

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 > 20000000 Then
strBackupLog = objLogFile.BackupEventLog _
(“c:\scripts\” & objLogFile.LogFileName & “.evt”)
objLogFile.ClearEventLog()
End If
Next

Leave a Reply

Your email address will not be published. Required fields are marked *

Kontrol / Control * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.