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
- 1.0, Initial community release
- 1.1, PowerShell hygiene applied, some typo fixes
- Download and follow at Github: https://github.com/Apoc70/Set-Webserver
- Download and like at TechNet Gallery: https://gallery.technet.microsoft.com/Change-IIS-Log-File-e4bd3f4b
Additional credits go to Michel de Rooij, https://eightwone.com