Change IIS Log File Settings

Description

This script reconfigures the IIS log folder to use a different folder instead of the default C:\inetpub\logs 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.

Examples

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

Links

Script last updated: 2016-07-28

Additional Credits

Additional credits go to Michel de Rooij, https://eightwone.com

Follow

%d Bloggern gefällt das: