PowerShell for Microsoft Exchange Message Tracking

PowerShellAs a Microsoft Exchange 2010 administrator I am often asked to get information about messages that have been sent, received, or that didn’t get to or from their destination. Microsoft provides the Message Tracking tools to be able to do this from the Exchange Management Console in Exchange 2010.

In Microsoft Exchange 2003 the Message Tracking feature entirely based in the administrative console, but luckily since Exchange 2007 we have been able to access the same features and functions using PowerShell and the Exchange Management Shell.

Let’s assume that you have been asked by someone in your client environment who needed to see if an email was received properly. They provide you with the information that you request which will be the sender address (someaddress@yourdomain.com), subject (Important information that I need feedback on) and a time window in which to search (May 25th between 5-8:30 AM).

Using this criteria, we will feed parameters to the Get-MessageTrackingLog CmdLet as follows:

get-messagetrackinglog -Sender someaddress@yourdomain.com -MessageSubject “Important information that I need feedback on” -Start “5/25/2012 5:00:00 AM” -End “5/25/2012 8:30:00 AM”

No really, it is just that easy. You can get the same results through the Exchange Management Console, but by using the PowerShell environment you can also take the results and perform actions against them such as further filtering, sorting and passing the information to and from other processes or to output files.

This is one if the many very handy CmdLets to have ready for administering your environment. This can be run from the server console or you may also run it from a workstation which has the Exchange Management Shell installed locally. This is how I do most of my Exchange 2010 PowerShell management which reduces the need to be logging onto server consoles unnecessarily.

I hope that this saves you some time, and feel free to experiment with the parameters and using the pipeline features of PowerShell to manage the results for your specific needs. The TechNet article for the Get-MessageTrackingLog CmdLet can be found here: http://technet.microsoft.com/en-us/library/aa997573.aspx

Happy Scripting!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.