0

I manage a domain with 4 domain controllers and i have been asked to enable Debug Logging for Incoming and Request packets. I have set the maximum size of the log file to 500MB.

First question I have, when it reaches 500MB it overwrites the log file or deletes it and start over from scratch

After enabling the debug logging I've been asked to create a daily scheduled task on each domain controller to copy the log files to a network path. Is it possible to create a script/bat file that copies the log files to that network path ? Or what options do I have ?

1 Answer 1

0

I waited until the log file reached 500MB and as it turns it deleted all the logs and started from zero again.

I created this script to use as a daily task:

$date = get-date -format "yyyyMMdd"
$Folder = $date.trim()
$newpath = "dom01.log" + $date.trim() + ".log"

robocopy C:\windows\system32\dns \\MyDomain\resources\Scripts\DNS\logs\$Folder dom01.log /r:1 /w:3

Everything works just fine but this raises another question. If the log file starts from zero when its max limit is reached we will always have some missing logs cause it will be impossible with this method to calculate the exact date when to copy the log file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .