PoshTip #12 – Message Tracking in Exchange Server 2013
The message tracking is a useful way to track all the messages in an Exchange server. Below are some examples :
List all the messages since “November 3 2015” (“Out-GridView” will presents information in a grid view) :
Get-MessageTrackingLog -Start “november 3 2015” | Out-GridView
Use a query to display information (Event ID, Sender …) and add the -ResultSize parameter (display more than 1000 rows) :
Get-MessageTrackingLog -Start “november 3 2015” -ResultSize Unlimited | select-object eventid,timestamp,messageid,sender,recipients,messagesubject | out-gridview
List all messages with the recipient “John.Smith@contoso.com” between 07:00 AM and 01:00 PM on december 9, 2015 (Order by TimeStamp)
Get-MessageTrackingLog -Start "12/9/2015 7:00AM" -End "12/9/2015 01:00PM" -recipients "john.smith@contoso.com" | Sort-Object Timestamp
Find sent emails from “*@contoso.com” :
Get-Messagetrackinglog -Resultsize Unlimited | Where {$_.Sender -match "@contoso.com"}
Find received emails to “*@contoso.com” :
Get-Messagetrackinglog -Resultsize Unlimited | Where {$_.Recipients -Like "*@contoso.com"}
Find all emails with specific message subject :
Get-MessageTrackingLog -resultsize unlimited -Start "12/8/2015 11:00:00 PM" -End "12/9/2015 07:00:00 AM" | where {$_.MessageSubject -like "*Your settings*"}