Is there anyway to use Windows task Scheduler to schedule a taks that will save an event log (specifically the Security Log) and then clear the log? If so does, anyone know how I could do it?
Thank you bcastner...this is exactly what I've been searching for. I found the third party tools you mentioned along with a couple others, but I was really wanting to script it myself.
Bcastner..I'm sorry to bother you again, but is there any chance you can explain the kix script you showed above. Once it is created in a notepad file, does it need to be renamed with the .kix file extension or can it stay as a .txt?
Also I tried running the script (as a .txt using kix32 driveletter:\path\filename) and I received the following error message:
1. sorry, this line was truncated in my original response:
To run the script:
Start, Run, kix32
Should read: Start, Run, kix32 Event_Backup.kix
2. Lets make the pathing clearer:
; Do the backup of Security log
$RCODE = BackUpEventLog("Security", "C:\BACKUP.EVT\Seclog.evt")
If @ERROR <> 0
? "Error backup up Security Log."
Endif
; Now clear the existing security log
$RCODE = ClearEventLog("Security")
If @ERROR <> 0
? "Error Clearing Security Log."
Endif
Other notes:
. Remember to use the RunAs facility of scheduled tasks to schedule the job as the local Administrator.
. You can use UNC names and create event logs on remote computers as well. Create a folder on each machine with the same name, e.g. BACKUP.EVT and use UNC naming. (You would need administrative privileges on each machine, or Domain Admin rights):
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.