[go: up one dir, main page]

0% found this document useful (0 votes)
20 views11 pages

Clearing Log Files With Task Scheduler

The document provides a step-by-step guide for setting up a scheduled task in Task Scheduler to clean Exchange logs. It details the configuration of the task, including setting the name, user account, triggers, and actions using PowerShell. After scheduling, it instructs to run the task and verify that the logs have been cleared from specified directories.

Uploaded by

surafel amare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views11 pages

Clearing Log Files With Task Scheduler

The document provides a step-by-step guide for setting up a scheduled task in Task Scheduler to clean Exchange logs. It details the configuration of the task, including setting the name, user account, triggers, and actions using PowerShell. After scheduling, it instructs to run the task and verify that the logs have been cleared from specified directories.

Uploaded by

surafel amare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Log cleaning

Start Task Scheduler.

Click the Task Scheduler Library and click New folder… Name the
folder Exchange and click OK.
Click the created Exchange folder. Click Create Task…
We have three tabs that we are going to fill in. The tabs
are General, Triggers, and Actions.
We start with the first tab General.

Give the task name CleanupLogs. Change user account to SYSTEM.


Enable Run with highest privileges. Select Configure for Windows
Server 2016 if you have a Windows Server 2016. If you have another
Windows Server version running, select that.
Click the tab Triggers. Click New…
Select the settings Daily. Configure which time the script needs to start
running. For example 22:00:00. Make sure that it’s Enabled and click OK.
Click the tab Actions. Click New…
Make sure to copy and paste below to both of the fields.

Program/script: Powershell.exe

Add arguments (optional): -ExecutionPolicy Bypass C:\Scripts\


CleanupLogs.ps1

Click OK.
Click OK.
The clear Exchange logs task is scheduled. From now on, the task scheduler
will automatically delete Exchange logs. In the next step, you will run the
script to test if all is working great.

Run the cleanup Exchange logs task in


task scheduler
Click the created task CleanupLogs and Click Run. The Last Run
Result will show that The operation completed successfully. (0x0).
Make sure to check if the CleanupLogs task did clear the logs in the following
folders.

C:\inetpub\logs\LogFiles\
C:\Program Files\Microsoft\Exchange Server\V15\Logging\
C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\ETLTraces\
C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\Logs\

You might also like