/build/static/layout/Breadcrumb_cap_w.png

Backup Event Log Per App

 

 

set LogFileSet = GetObject("winmgmts:{impersonationLevel=impersonate,(Backup)}").ExecQuery("select * from Win32_NTEventLogFile where LogfileName='Application'")

 

For each Logfile in LogFileSet

                RetVal = LogFile.BackupEventlog("c:\BACKUP.LOG")

                if RetVal = 0 then WScript.Echo "Log Backed Up"

                RetVal = LogFile.ClearEventlog()

                if RetVal = 0 then WScript.Echo "Log Cleared"

Next


Comments

This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ