Recently one of the customer reported that their C:\ drive gets full very often on SCCM server. After some investigation it was found that SCCM IIS log files were occupying huge space on C: drive. The SCCM IIS logs files are usually stoted in C:\Inetpub\Logs\LogFiles. The size of log files be anywhere between 10MB to 700MB. The logging is so rigorous that sometimes the log files eat up complete C: drive space.
In such situations how do you delete old SCCM IIS log files ?. Is it safe to delete to delete those SCCM IIS log files ?. While there are many best practices out there to manage IIS Log File Storage, it all depends on which method do you choose. Listed below are some of the methods to delete old SCCM IIS Log files.
In this post i will go with second method, i.e. cleaning log files using IIS log cleaner tool.
- Delete the IIS log files manually.
- Clean up log files using IIS Log Cleaner Tool.
- Disable IIS Logging.
- Use a Powershell script that deletes log files and schedule it to run every week/month.
- Enable Folder compression to compress IIS log files.
What is IIS Log Cleaner Tool – IIS Log cleaner tool is third party tool. This tool cleans up IIS log folder automatically by deleting log files older than a maximum age that you set. The log files are moved to the Recycle bin to avoid potential data loss. While the tool is not officially supported by Microsoft, it works well and can be used for cleaning up log files.
Delete Old SCCM IIS Log files using IIS Log Cleaner Tool
To delete old SCCM log files using IIS log cleaner tool, download the tool from here. Save it on the machine where you want to use it. Before we proceed i want to show you logging settings in IIS. Open IIS Manager on your local Web server. In IIS Manager, in the Connections pane, select the Web site. Double-click Logging.
Notice the default directory is set to %SystemDrive%\inetpub\logs\LogFiles.
This opens up settings file in a notepad. The text file includes command to clean up log files. You can change MaxAge from 30 days to custom days. The settings.txt file is stored in the same folder as IISLogCleaner.
Save the settings (in case you have changed) and right click on IIS icon in notification area. Click Clean Now and wait for the tool to clean up the log files. As mentioned earlier, the cleaner tool doesn’t delete the files, rather it moves log files to recycle bin.
In the below screenshot you can notice the log cleaner tool worked really well. I could gain back good amount of space on disk. Therefore try this tool and let me know how it helped you in the comments section.