I am in the process of changing my server build-out scripts to DSC and am being forced to deal with an IIS Log File Maintenance routine, I cobbled together years back.
Right now, it is a separate script (one for 2003, one for 2008, there was some incompatibility with 2012 I haven’t dealt with) that I run on all servers with IIS. The script finds the log drive, creates a new Log folder, creates an Archive and a Bin folder within that, puts an archiving/purging script and the Info-Zip executable in the bin folder, then creates a scheduled task to run the script every night. I’d like to also add changing all IIS log paths to this location to the script.
Before I go any further (custom DSC Resource?) I wanted to ask the community, how are you handling IIS’s lack of a built-in log maintenance solution?
This seems like a basic feature that IIS should have by now. Maybe I’m missing something.