Configure IIS log file settings
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.md
README.md
Set-Webserver.ps1

README.md

Set-Webserver.ps1

Configures Internet Information Server (IIS) log file settings

Description

This script reconfigures the IIS log folder to target a different folder besides 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 webite level, not all settings will be inherited.

Parameters

LogFolderPath

New IIS log folder path, i.e. D:\IISLogs. Default is an empty string.

LogFilePeriod

Log file period (interval), Hourly|Daily|Weekly|Monthly|MaxSize MaxSize configuration not yet implemented

LocalTimeRollover

Boolean parameter indicating, if the local time shall be used for filenames and rollover Default $FALSE

Examples

.\Set-Webserver.ps1 -LogFolderPath D:\IISLogs

Change the IIS log file location to D:\IISLogs

.\Set-Webserver.ps1 -LogFilePeriod Hourly

Change the IIS log period to an hourly period

.\Set-Webserver.ps1 -LocalTimeRollover $true

Use the local time for filenames and log file rollover

Note

THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.

TechNet Gallery

Download and vote at TechNet Gallery

Credits

Written by: Thomas Stensitzki

Stay connected:

For more Office 365, Cloud Security, and Exchange Server stuff checkout services provided by Granikos

Additional Credits