≡ Menu

Powershell Query and Change Exchange messaging tracking log settings


Like Exchange 2003, there is no GUI available in Exchange 2007/2010 to make changes to Exchange Message tracking log settings. These settings involve, how many days of logs you want to store, what is the max size of each log, what is the total space you want to allocate to the tracking logs, and location of the logs on disk.

To query exchange tracking log settings, use the below command

[PS] C:Userslocaluser>Get-TransportServer -Identity HTSSERVER1 | fl *messagetracking*

MessageTrackingLogEnabled               : True
MessageTrackingLogMaxAge                : 15.00:00:00
MessageTrackingLogMaxDirectorySize      : 100MB
MessageTrackingLogMaxFileSize           : 10MB
MessageTrackingLogPath                  : C:Program FilesMicrosoftExchange ServerTransportRolesLogsMessageTracking
MessageTrackingLogSubjectLoggingEnabled : True

The above command returns total six parameters and each has its own significance. Their names are self explanatory as well.

If you want to turn off the messaging tracking, just use the below command.

Set-TransportServer HTSSERVER1 –MessageTrackingLogEnabled $false

Change the value to $true if you want to turn on the logging.

I am giving some more examples below to change other parameters.

To change the LogMaxage(no. of days logs you want to store) to 20 days,

Set-TransportServer -id HTSSERVER1 –MessageTrackingLogMaxAge 20.00:00:00

This parameter value is in DD.HH.MM.SS format.

To change the tracking logs location

Set-TransportServer -id HTSSERVER1 –MessageTrackingLogPath “E:MessageTrackingLogs”

To change total space allowcated for logs:

Set-TransportServer -id HTSSERVER1 –MessageTrackingLogMaxDirectorySize 1GB

To enable subject logging in message tracking:

Set-TransportServer -id HTSSERVER1 –MessageTrackingLogSubjectLoggingEnabled $true

Hope this information helps you.