How to Easily Export Message Tracking Results in Exchange Server 2007
Published Dec 01 2008 06:12 PM 80.6K Views

EDIT: We updated this post on 12/9/2008 and corrected the step 4 below.

I had a case earlier this month where the customer wanted a simple way to export the results of message tracking.  In the Exchange Management Console, he used the Message Tracking feature under Toolbox to configure a set of messaging tracking parameters and then received the results, as in this example:

Although there is no way in the console to export this to a text or csv file, you can follow these steps to export to CSV:

1. Configure message tracking parameters the way you need them and view the results to confirm.

2. Scroll to the bottom of the Message Tracking Results screen, and click Go Back.

3. Copy the get-messagetrackinglog command syntax from the Exchange Management Shell command field:

4. Open the Exchange Management Shell, paste in the copied get-messagetrackinglog command, and add the following to the end of the command:

This will create a CSV file of the message tracking results with column headers that can then be imported into Excel, for example.

- Kristi Simmons

10 Comments
Not applicable
That’s a good way and the one I use to create statistical reports based on message tracking (exporting the output to an excel file).

Another way (which I haven’t tested yet!) is using Scriptacular from Mihai Jalobeanu and Vivek Sharma (http://www.viveksharma.com/TECHLOG/archive/2006/12/21/announcing-the-exchange-2007-powershell-script...).
Theres is a script, called out-html.ps1, in that pack that exports the results from a command to .html webpage. You can see an example in this article from Anderson Patricio: http://www.msexchange.org/articles_tutorials/exchange-server-2007/tools/using-exchange-server-2007-b...

But I think the first method is the best one.
Not applicable
Hi,

this no really good idea, since the Receipients are passed in a System.String[] which isn't expanded. This means: you can't get the Receipients out of your csv. I'm astonished that you're posting such an incomplete Tip.
A workaround for this should be a additional "select": get-messagetracking ... | selectTimestamp, {$_.recipients}, MessageSubject,... | export-csv... (not fully tested).

Bye Filipp
Not applicable
PowerShell with Exchange cmdlets makes my life easier every single day !
Not applicable
Thanks for pointing out the issue with the Recipients column.  The article has been corrected.
Not applicable
Am I dreaming? What a command line. Why is there no "export to csv" button in the normal message tracking shell?
Not applicable
another nice feature is to use the convertto-HTML option, this way use can easily create your own reporting... and it's nice to play around with

get-messagetrackinglog -Sender:<<somebody>> -EventID "RECEIVE" -Start "12/1/2008 2:04:00 PM" -End "12/30/2008 2:14:00 PM" | convertto-HTML TimeStamp,ServerHostName,Sender,{$_.recipients},MessageSubject| out-file M_Tracks.html

Pipe it with
Get-Exchangeserver | where-object {$_.IsHubTransportServer -eq "True"}
and you track from all HT servers in your organization

Not applicable
I would like to try this, but I need to run it on multiple servers.  Is this possible with one line?  example get-messagetrackinglog -Recipients:jon.doe@test.com  -Server "testhub01,tesrhub02" -Start "1/21/2009 6:42:00 AM" -End "1/21/2009 10:52:00 AM"

I can't get the multiple hubs part to work in the command and haven't seen any examples.  Thanks for any input.
Not applicable
You can use this to retrieve all HT servers from your organization:

Get-ExchangeServer | where {$_.IsHubTransportServer -eq "true"}

Pipe this output (you can sort this output) to the get-messagetrackinglog and you get this:

Get-ExchangeServer | where {$_.IsHubTransportServer -eq "true"} | sort-object Name | get-messagetrackinglog -Sender:<<somebody>> -EventID "RECEIVE" -Start "12/1/2008 2:04:00 PM" -End "12/30/2008 2:14:00 PM" | convertto-HTML TimeStamp,ServerHostName,Sender,{$_.recipients},MessageSubject| out-file M_Tracks.html
Not applicable
Thanks Jaap, that was very helpful and educational.  noober
Not applicable
What if I were to want to filter the messagetrackinglog to only look at, say, distribution groups, and I only wanted to show a message count?  I've gotten good results on a single recipient with | measure-object, but I'd like to get a message count for each DL.
Version history
Last update:
‎Dec 01 2008 06:12 PM
Updated by: