Pages

Monday, December 3, 2018

Delete old logs on Exchange servers

The following commands delestes logs older than 14 days on Exchange servers:
forfiles /p C:\inetpub\logs /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\ETLTraces /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\Logs /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Logging /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostics\PerformanceLogsToBeProcessed /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Logging\Monitoring\Monitoring\MSExchangeHMWorker\ActiveMonitoringTraceLogs /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp /s /m *.log /d -14 /c “cmd /c del @path”

No comments: