Welcome to Exchange Team Blog Sign in | Join | Help

Syndication

This Blog

How to Easily Export Message Tracking Results in Exchange Server 2007

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

Share this post :
Published Monday, December 01, 2008 3:12 PM by Exchange
Filed Under: , , , , ,

Comments

 

Nuno Mota said:

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-scriptacular-demo-pack.aspx).
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-built-in-scripts-part2.html

But I think the first method is the best one.
December 2, 2008 11:02 AM
 

filippg said:

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
December 3, 2008 7:46 AM
 

Aaron Johnson said:

PowerShell with Exchange cmdlets makes my life easier every single day !
December 3, 2008 8:06 PM
 

Kristi Simmons said:

Thanks for pointing out the issue with the Recipients column.  The article has been corrected.
December 21, 2008 1:34 PM
 

Michael Rübel said:

Am I dreaming? What a command line. Why is there no "export to csv" button in the normal message tracking shell?
December 22, 2008 8:45 AM
 

Jaap Wesselius said:

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

December 30, 2008 9:25 AM
 

exchangenoober said:

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.
January 21, 2009 12:24 PM
 

Jaap wesselius said:

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
January 23, 2009 8:40 AM
 

exchangenoober said:

Thanks Jaap, that was very helpful and educational.  noober
January 23, 2009 9:23 AM
 

Matt W said:

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.
February 18, 2009 4:16 PM
New Comments to this post are disabled

News


This blog and its contents are provided "AS IS" with no warranties, and they confer no rights. Use of any included script samples are subject to the terms specified in the Terms of Use.
New! Would you like to suggest a topic for the Exchange team to blog about? Send suggestions to us.

Exchange Server 2010 - Get the Beta



Poll:

Other Exchange Blogs from MSFT