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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*

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