Reclaiming Disk Space Lost to IIS Logs on SBS 2003 and SBS 2008

[Today's post comes to us courtesy of Justin Crosby and Wayne McIntyre]

Today we are going to discuss an SBS "house cleaning" tip.  If you have been running SBS 2003/2008 for awhile you may be using a lot of disk space to store old IIS logs.  This is especially true if your clients are heavy OWA, ActiveSync, RPC over HTTP, or SharePoint users.  A recent customer of mine had files dating back to 2004 and was using almost 2 Gigabytes of hard drive space to store these old logs.

To reclaim this space all you need to do is to delete the old IIS log files.  Please be sure to back them up before deleting, just in case you need the logs in the future.  I usually try to keep a week’s worth of logs and delete everything older than that.  The logs will be in folders underneath C:\Windows\System32\LogFiles\ in SBS 2003 and C:\inetpub\logs\LogFiles in SBS 2008 by default.   Additionally there is a Remote Web Workplace log stored in SBS 2008 in the following location which can grow rather large C:\Program Files\Windows Small Business Server\Logs\WebWorkplace.   If your log files are not stored in the default location, you can run the below command to determine the log file directory configured in IIS.


Note: It is inadvisable to search your hard drive(s) for *.log and delete all that you find.  Many programs actively use information stored in .log files, such as Exchange, and deleting the file may cause issues including potential data loss.