I am a programing newbe and need help writing a WMI script that will backup and clear the Security event log on a Windows 2000 server. Does any one know where I can find one to use as and example?
If any one can help me, this is what I have come up with so far. I want to use eventlog.pl to backup the Security log to a .txt file and then clear it. Name the text file with the file structure of dd_mm_yyy, and store it to a given path. I feel like I am so close to getting this but I can not tie it together. I need someone who knows scripting to guide me a little here.
Windows 2000 Scripting guide has sample that will do part of this, it just will not convert it to a .txt file. How can I incorperate these two items.
Thanks any way, none of the answers really gave me what I needed to get it to work. But here is what I wrote so if any one else needs it, change it to meet your needs.
: Batch Start
for /F "tokens=1-4 delims=/- " %%A in ('date/T') do set DATE=%%B%%C%%D
Eventlog.pl -export security -format csv -file C:\EventLog\Security%DATE%.csv
Eventlog.pl -backup security -file D:\EventLog\Security%DATE%.evt
Eventlog.pl -clear security
: Batch End
This batch will export the file, and name it for the month,day and year. Also it will back it up so it can be saved to removeable storage. And last but not least clear the log.
cempasha
This question is still open and getting old. If any of the comment(s) above helped you please accept it as an answer or split the points who ever helped you in this question. Your attention in finalising this question is very much appreciated. Thanks in advance,
****** PLEASE DO NOT ACCEPT THIS AS AN ANSWER ********
- If you would like to close this question and have your points refunded, please post a question in community support area on https://www.experts-exchange.com/Community_Support/ giving the address of this question. Thank you
Monitor Event Logs
http://www.microsoft.com/technet/scriptcenter/monitor/scrmon21.asp