How to Configure Message Tracking

Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.

 

Applies to: Exchange Server 2007, Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3

This topic explains how to use the Exchange Management Console and the Exchange Management Shell to configure message tracking in Microsoft Exchange Server 2007.

Note

Any message tracking settings that are configurable by using the Exchange Management Console are available only in Microsoft Exchange Server 2007 Service Pack 1 (SP1). All message tracking settings are configurable by using the Exchange Management Shell in Exchange 2007 SP1 and in the release to manufacturing (RTM) version of Microsoft Exchange Server 2007.

Message tracking records the Simple Mail Transfer Protocol (SMTP) transport activity of all messages that are transferred to and from an Exchange 2007 computer that has the Hub Transport, Mailbox, or Edge Transport server role installed. You can use message tracking logs for message forensics, mail flow analysis, reporting, and troubleshooting.

Before You Begin

To perform the following procedures, the account you use must be delegated the following:

  • Exchange Organization Administrator role

To perform the following procedures on a computer that has the Edge Transport server role installed, you must log on by using an account that is a member of the local Administrators group on that computer.

For more information about permissions, delegating roles, and the rights that are required to administer Exchange 2007, see Permission Considerations.

To modify the message tracking settings on a server that has both the Mailbox server role and the Hub Transport server role installed, use the Set-MailboxServer cmdlet or the Set-TransportServer cmdlet.

Enabling or Disabling Message Tracking

By default, message tracking is enabled on all Exchange 2007 computers that have the Hub Transport, Mailbox, or Edge Transport server roles installed.

Note

You can enable or disable message tracking by using the Exchange Management Console only in Exchange 2007 SP1.

To use the Exchange Management Console to enable or disable message tracking on a Hub Transport server or Edge Transport server in Exchange 2007 SP1

  1. Open the Exchange Management Console. Perform one of the following steps:

    • On a computer that has the Edge Transport server role installed, select Edge Transport, and then in the action pane, click the Properties link that is directly under the server name.

    • On a computer that has the Hub Transport server role installed, in the console tree, expand Server Configuration, and select Hub Transport. In the action pane, click the Properties link that is directly under the server name.

  2. In the Properties page, click the Log Settings tab.

  3. In the Message tracking log section, perform one of the following steps:

    • Select Enable message tracking log to enable message tracking.

    • Clear Enable message tracking log to disable message tracking.

  4. Click Apply to save changes and remain in the Properties page, or click OK to save changes and exit the Properties page.

To use the Exchange Management Shell to enable or disable message tracking on a Hub Transport server or Edge Transport server in Exchange 2007 SP1 or Exchange 2007 RTM

  • Run the following command:

    Set-TransportServer <Identity> -MessageTrackingLogEnabled <$true | $false>
    

    For example, to disable message tracking on an Exchange 2007 computer that is named Exchange01, run the following command:

    Set-TransportServer Exchange01 -MessageTrackingLogEnabled $false
    

To use the Exchange Management Shell to enable or disable message tracking on a Mailbox server in Exchange 2007 SP1 or Exchange 2007 RTM

  • Run the following command:

    Set-MailboxServer <Identity> -MessageTrackingLogEnabled <$true | $false>
    

    For example, to disable message tracking on an Exchange 2007 computer that is named Mailbox01, run the following command:

    Set-MailboxServer Mailbox01 -MessageTrackingLogEnabled $false
    

Configuring the Location of Message Tracking Logs

By default, the message tracking logs are stored in the C:\Program Files\Microsoft\Exchange Server\TransportRoles\Logs\MessageTracking directory. The directory must be local to the Exchange 2007 computer. In a single copy cluster (SCC) environment, move the message tracking log directory to a physical disk resource that is located on the shared storage resource. This enables searches of message tracking logs to continue to function if a failover occurs.

Note

You can configure the location of the message tracking logs by using the Exchange Management Console only in Exchange 2007 SP1.

To use the Exchange Management Console to change the location of the message tracking logs on a Hub Transport server or Edge Transport server in Exchange 2007 SP1

  1. Open the Exchange Management Console. Perform one of the following steps:

    • On a computer that has the Edge Transport server role installed, select Edge Transport, and then in the action pane, click the Properties link that is directly under the server name.

    • On a computer that has the Hub Transport server role installed, in the console tree, expand Server Configuration, and select Hub Transport. In the action pane, click the Properties link that is directly under the server name.

  2. In the Properties page, click the Log Settings tab.

  3. In the Message tracking log section, click Browse next to Message tracking log path.

  4. In the Browse for folder window, browse to the new location where you want to store the message tracking log files. If you want to create a new folder, select a parent folder, click Make New Folder, and then type the name of the new folder. After you make your folder selection, click OK to close the Browse for folder window.

  5. Click Apply to save changes and remain in the Properties page, or click OK to save changes and exit the Properties page.

To use the Exchange Management Shell to change the location of the message tracking logs on a Hub Transport server or Edge Transport server in Exchange 2007 SP1 or Exchange 2007 RTM

  • Run the following command:

    Set-TransportServer <Identity> -MessageTrackingLogPath <LocalFilePath>
    

    For example, to change the location of the message tracking log to C:\Message Tracking on an Exchange 2007 computer that is named Exchange01, run the following command:

    Set-TransportServer Exchange01 -MessageTrackingLogPath "C:\Message Tracking"
    

To use the Exchange Management Shell to change the location of the message tracking logs on a Mailbox server in Exchange 2007 SP1 or Exchange 2007 RTM

  • Run the following command:

    Set-MailboxServer <Identity> -MessageTrackingLogPath <LocalFilePath>
    

    For example, to change the location of the message tracking log to C:\Message Tracking on an Exchange 2007 computer that is named Mailbox01, run the following command:

    Set-MailboxServer Mailbox01 -MessageTrackingLogPath "C:\Message Tracking"
    

If you set the value of the MessageTrackingLogPath parameter to $null, you effectively disable message tracking. However, if you set the value of the MessageTrackingLogPath parameter to $null when the value of the MessageTrackingLogEnabled attribute is $true, you will generate event log errors. The preferred method to disable message tracking is to use the MessageTrackingLogEnabled parameter with the Set-TransportServer cmdlet or the Set-MailboxServer cmdlet.

When you change the location of the message tracking log directory, this change does not copy any existing log files from the old directory to the new directory. The new message tracking log directory is active almost immediately after the configuration change, but any existing log files are left in the old directory.

The following permissions are required on the message tracking log directory:

  • Administrator: Full Control

  • System: Full Control

  • Network Service: Read, Write, and Delete Subfolders and Files

By default, the Exchange Transport service uses the security credentials of the Network Service user account to create the new message tracking log directory and apply the correct permissions. If the new message tracking log directory does not already exist, and the Network Service account has the rights that are required to create folders and apply permissions at the new location, the new message tracking log directory is created and the correct permissions are applied to the new directory. If the new message tracking log directory already exists, the existing folder permissions are not checked. Whenever you move the message tracking log directory by using the MessageTrackingLogPath parameter with the Set-TransportServer cmdlet or the Set-MailboxServer cmdlet, it is always a good idea to verify the new message tracking log directory and to verify that the new directory has the correct permissions applied to it. If your change to the message tracking log directory is not successful, you can create the new message tracking log directory and apply the correct permissions to it before you use the MessageTrackingLogPath parameter with the Set-TransportServer cmdlet or the Set-MailboxServer cmdlet.

Configuring the Size of Each Message Tracking Log File

By default, the maximum size for each message tracking log file is 10 MB. When a message tracking log file reaches its maximum size, Exchange 2007 opens a new message tracking log file. This process continues until either of the following conditions is true:

  • The message tracking log directory reaches its specified maximum size. For more information about how to change the maximum size of the message tracking log directory, see "Configuring the Maximum Size of the Message Tracking Log Directory" later in this topic.

  • A message tracking log file reaches its specified maximum age. For more information about how to change the maximum age for a message tracking log file, see "Configuring the Maximum Age for the Message Tracking Log" later in this topic.

After the maximum size or age limit is reached, circular logging deletes the oldest message tracking log files.

Note

By default, the transport logging process has a logging level value of 0 (Lowest). If you want Microsoft Exchange to write an event log entry when circular logging removes a log file, you must change the logging level value of the transport logging process to 5 (Maximum) or 7 (Expert). For more information, see How to Change Logging Levels for Exchange Processes.

To use the Exchange Management Shell to change the maximum size of individual message tracking log files on a Hub Transport server or Edge Transport server

  • Run the following command:

    Set-TransportServer <Identity> -MessageTrackingLogMaxFileSize <FileSize>
    

    For example, to set the maximum size of a message tracking log file to 20 MB on an Exchange 2007 computer that is named Exchange01, run the following command:

    Set-TransportServer Exchange01 -MessageTrackingLogMaxFileSize 20MB
    

To use the Exchange Management Shell to change the maximum size of individual message tracking log files on a Mailbox server

  • Run the following command:

    Set-MailboxServer <Identity> -MessageTrackingLogMaxFileSize <FileSize>
    

    For example, to set the maximum size of a message tracking log file to 20 MB on an Exchange 2007 computer that is named Mailbox01, run the following command:

    Set-MailboxServer Mailbox01 -MessageTrackingLogMaxFileSize 20MB
    

When you enter a value for the MessageTrackingLogMaxFileSize parameter, qualify the value with one of the following units:

  • B (bytes)

  • KB (kilobytes)

  • MB (megabytes)

  • GB (gigabytes)

  • TB (terabytes)

Unqualified values are treated as bytes. The value of the MessageTrackingLogMaxFileSize parameter must be less than or equal to the value of the MessageTrackingLogMaxDirectorySize parameter. The valid input range for either parameter is 1 to 9223372036854775807 bytes.

Configuring the Maximum Size of the Message Tracking Log Directory

By default, the maximum size for the whole message tracking log directory is 250 MB. Circular logging deletes the oldest message tracking log files when either of the following conditions is true:

  • A message tracking log file reaches its specified maximum age.

  • The message tracking log directory reaches its specified maximum size.

    Important

    The maximum size of the message tracking log directory is calculated as the total size of all log files that have the same name prefix. Other files that do not follow the name prefix convention are not counted in the total directory size calculation. Renaming old log files or copying other files into the message tracking log directory could cause the directory to exceed its specified maximum size. When the Hub Transport server role and the Mailbox server role are installed on the same server, the maximum size of the message tracking log directory is not the specified maximum size because the message tracking log files that are generated by the different server roles have different name prefixes. Message tracking log files for the Hub Transport server role or Edge Transport server role begin with the name prefix MSGTRK. Message tracking log files for the Mailbox server role begin with the name prefix MSGTRKM. When the Hub Transport server role and the Mailbox server role are installed on the same server, the maximum size of the message tracking log directory is two times the specified value.

To use the Exchange Management Shell to change the maximum size of the message tracking log directory on a Hub Transport server or Edge Transport server

  • Run the following command:

    Set-TransportServer <Identity> -MessageTrackingLogMaxDirectorySize <DirectorySize>
    

    For example, to set the maximum size of the message tracking log directory to 400 MB on an Exchange 2007 computer that is named Exchange01, run the following command:

    Set-TransportServer Exchange01 -MessageTrackingLogMaxDirectorySize 400MB
    

To use the Exchange Management Shell to change the maximum size of the message tracking log directory on a Mailbox server

  • Run the following command:

    Set-MailboxServer <Identity> -MessageTrackingLogMaxDirectorySize <DirectorySize>
    

    For example, to set the maximum size of the message tracking log directory to 400 MB on an Exchange 2007 computer that is named Mailbox01, run the following command:

    Set-TransportServer Mailbox01 -MessageTrackingLogMaxDirectorySize 400MB
    

When you enter a value for the MessageTrackingLogMaxDirectorySize parameter, qualify the value with one of the following units:

  • B (bytes)

  • KB (kilobytes)

  • MB (megabytes)

  • GB (gigabytes)

  • TB (terabytes)

Unqualified values are treated as bytes. The value of the MessageTrackingLogMaxFileSize parameter must be less than or equal to the value of the MessageTrackingLogMaxDirectorySize parameter. The valid input range for either parameter is 1 to 9223372036854775807 bytes.

Configuring the Maximum Age for the Message Tracking Logs

By default, the maximum age for any message tracking log file is 30 days. Circular logging deletes the oldest message tracking log files if either of the following conditions is true:

  • The message tracking log directory reaches its specified maximum size.

  • A message tracking log file reaches its specified maximum age.

Note

By default, the transport logging process has a logging level value of 0 (Lowest). If you want Microsoft Exchange to write an event log entry when circular logging removes a log file, you must change the logging level value of the transport logging process to 5 (Maximum) or 7 (Expert). For more information, see How to Change Logging Levels for Exchange Processes.

To use the Exchange Management Shell to change the maximum age for a message tracking log file on a Hub Transport server or Edge Transport server

  • Run the following command:

    Set-TransportServer <Identity> -MessageTrackingLogMaxAge <Age>
    

    For example, if you want to change the maximum age of a message tracking log file to 45 days on an Exchange 2007 computer that is named Exchange01, run the following command:

    Set-TransportServer Exchange01 -MessageTrackingLogMaxAge 45.00:00:00
    

To use the Exchange Management Shell to change the maximum age for a message tracking log file on a Mailbox server

  • Run the following command:

    Set-MailboxServer <Identity> -MessageTrackingLogMaxAge <Age>
    

    For example, if you want to change the maximum age of a message tracking log file to 45 days on an Exchange 2007 computer that is named Mailbox01, run the following command:

    Set-MailboxServer Mailbox01 -MessageTrackingLogMaxAge 45.00:00:00
    

To specify an age value, enter it as a time span, as follows: dd.hh:mm:ss where d = days, h = hours, m = minutes, and s = seconds. The valid input range for this parameter is 00:00:00 to 24855.03:14:07. Setting the value of the MessageTrackingLogMaxAge parameter to 00:00:00 prevents the automatic removal of message tracking log of files because of their age.

Configuring Message Subject Logging in the Message Tracking Logs

By default, the subject line of an SMTP e-mail message is stored in the message tracking log. However, you may want to disable message subject logging to comply with increased security or privacy requirements. Before you enable or disable message subject logging, make sure that you verify your organization's policy about revealing subject line information.

To use the Exchange Management Shell to enable or disable message subject logging in the message tracking logs on a Hub Transport server or Edge Transport server

  • Run the following command:

    Set-TransportServer <Identity> -MessageTrackingLogSubjectLoggingEnabled <$true|$false>
    

    For example, if you want to disable message subject tracking on an Exchange 2007 computer that is named Exchange01, run the following command:

    Set-TransportServer Exchange01 -MessageTrackingLogSubjectLoggingEnabled $false
    

To use the Exchange Management Shell to enable or disable message subject logging in the message tracking logs on a Mailbox server

  • Run the following command:

    Set-MailboxServer <Identity> -MessageTrackingLogSubjectLoggingEnabled <$true|$false>
    

    For example, if you want to disable message subject tracking on an Exchange 2007 computer that is named Mailbox01, run the following command:

    Set-MailboxServer Mailbox01 -MessageTrackingLogSubjectLoggingEnabled $false
    

For detailed syntax and parameter information, see Set-TransportServer and Set-MailboxServer.

For More Information

For more information about message tracking, see Managing Message Tracking.