I frequently need to export the exchange message tracking logs with the recipients included in the CSV report. The first few times I needed to do this I tried multiple ways to accomplish this until I found this blog post by the exchange team. Just adding this to my blog for an easy reference point and maybe help someone else.

   1: Get-MessageTrackingLog -server <server> -Start "10/21/2013 12:00 PM" -ResultSize Unlimited -end "10/22/2013 09:30 AM" -EventID Send | Select timestamp,MessageSubject,Sender,{$_.recipients} | export-csv C:reports.csv

I recently needed to generate a report of all emails sent from a single application that I knew was the only application sending from a unique IP address.  Initial attempts lead to some problems getting the recipients email address into the csv export, until I found this blog post from the exchange team.

Here is the powershell command I used to filter by clientIP

Get-MessageTrackingLog -ResultSize unlimited -Start "4/8/2013 12:00AM" -End "7/8/2013 11:59PM" | Select Timestamp,  messagesubject, sender, {$_.recipients}, Clientip, {$_.recipientsstatus} | Where {$_.ClientIp -eq ''} | Export-CSV C:reports.csv


This is just a quick post to use as a reference for when writing powershell scripts for orchestrator. I will update this post in the future with other useful Import-Module powershell snippets as I write them or run across them in my runbooks.

The snippets that don’t say Remote connection next to them you need to have the powershell Cmdlets installed locally on your Orchestrator Server.

Continue reading