Delete Old SCCM IIS Log files using IIS Log Cleaner Tool

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. Delete Old SCCM IIS Log files using IIS Log Cleaner Tool Snap1
Notice the default directory is set to %SystemDrive%\inetpub\logs\LogFiles.Delete Old SCCM IIS Log files using IIS Log Cleaner Tool

Right click IISLogCleaner executable and run it as administrator. Delete Old SCCM IIS Log files using IIS Log Cleaner Tool

You will be prompted with a box that asks you to review default settings of the tool. The tool now sits in notification area / system tray. Delete Old SCCM IIS Log files using IIS Log Cleaner Tool

Right click IIS icon in system tray and click Settings. On the message box click OK. Delete Old SCCM IIS Log files using IIS Log Cleaner Tool

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. Delete Old SCCM IIS Log files using IIS Log Cleaner Tool

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. Delete Old SCCM IIS Log files using IIS Log Cleaner Tool

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.

BeforeDelete Old SCCM IIS Log files using IIS Log Cleaner Tool

AfterDelete Old SCCM IIS Log files using IIS Log Cleaner Tool

 

4 Comments

  1. its 2020 & this is still very useful

  2. Avatar photo Venu Kumar Bingi says:

    Hi Prajwal,

    We are facing high cpu usage due to iis worker process in our sccm server, could you please help me.

  3. Good post, thanks Prajwal!

Leave a Reply

Your email address will not be published. Required fields are marked *