Toll Free: +1 888 900 4529 |   Toll Free: +44 800 088 5522

Message Tracking Logs using PowerShell in Exchange 2010

Robin Thomas | February 12th, 2015 | exchange 2010

One of Important and precious facility provided by Exchange Serve is “Message Tracking Logs”. The whole transfer of messages (Send/Receive) can be easily monitored using this Feature of Exchange Server.

In Exchange server Edge Transport, Mail Servers and Hub Transport layers are responsible for the transmission of messages in the network. Message Tracking Logs can be called as the feature of these server roles. Tracking of message becomes sometimes necessary in troubleshooting the Exchange problems.

Now, In this blog, We will learn PowerShell Commands with which one can easily track messages.

Search Message Tracking Logs with Powershell

One can use the Get-MessageTrackingLog Cmdlet in the EMC to search Message Tracking Logs. The Cmdlet will give the tracking logs with all associated parameters as shown in figure.

Parameter “–Server” can be used to search remote server. This is mostly used when there are separate management Servers.

Searches of Message Tracking Logs on Hub Transport Server can be performed by using the command given below.

To search a particular server within a site one can use the Cmdlet given below.

After that, insert Cmdlet to the Get-MessageTrackingLog as shown below.

p5

One important point to be noted is that the command given above will only return 1000 results, as its default size is set to the 1000 results. To modify the results use “–Resultsize” Cmdlets

Collecting the results of queries in a Variable: –

If you are searching the logs in many servers than it is recommended to save the results of all the queries in a variable, so that we can use it in the future, if required.

The PowerShell Cmdlet given below is used to track the emails of Jay. The result of the command is stored in a different variable $msgs as shown below

To count the number of mails stored in the $msgs, use the command $msgs.count as shown below.

p8

There is no need to run the whole command again to search first 5 Sender, Just write Select –First 5 as shown in the fig.

Each message contains the number of log entries

Each message as shown above generates lots of log entries. That happens because every message that is sent or received has to pass through many events such as

Exporting the log data of Message Tracking Logs: –

Use command Export –CSV, If you want to store the results of Message Tracking logs to the CSV file. One problem with the command is that when you tries to analyze data from CSV, you will not find any useful information. It will show the names as System.String[] as shown below.

You have to pipe the results of tracking logs in Cmdlet to resolve the issue: –

Now you will find the resultant data in the original form

p13

The following two tabs change content below.

Robin Thomas

Robin Thomas is a technical writer. He wrote plenty of articles or blogs regarding Exchange server mailbox corruption problem and share its precise solution on Google Plus, Twitter and Facebook.