Change IIS Log File Settings

Share on twitter
Share on linkedin
Share on facebook
Share on stumbleupon
Share on xing
Share on email
Share on print


This script reconfigures the IIS log folder to use a different folder instead of the default C:inetpublogs folder.

Additionally, the log settings can be adjusted as well. The script changes the default log file location and settings on a server level.

By default, the settings are inherited by websites. If manual changes have been made on a website level, not all settings will be inherited.



Change the IIS log file location to D:IISLogs

.Set-Webserver.ps1 -LogFolderPath D:IISLogs

Change the IIS log period to an hourly period

.Set-Webserver.ps1 -LogFilePeriod Hourly

Use the local time for filenames and log file rollover

.Set-Webserver.ps1 -LocalTimeRollover $true

Version History

  • 1.0, Initial community release
  • 1.1, PowerShell hygiene applied, some typo fixes



Script last updated: 2016-07-28


Additional Credits

Additional credits go to Michel de Rooij,





%d Bloggern gefällt das: