Tuesday 25 June 2013

Message Tracking using Exchange Management Shell

We can use the Get-MessageTrackingLog shell command to quickly find the status of sent\received email. Use the below shell command to search for the emails sent between two users within particular interval and the details will be exported into CSV file for review
Get-MessageTrackingLog -ResultSize unlimited -Sender “Sender@emailaddress.com” –Recipient “Recipient@emailaddress.com” -Start "MM/DD/YYYY 00:00:00" -End "MM/DD/YYYY 23:59:00"|Select Timestamp, EventId, Source, SourceContext, MessageID, MessageSubject, Sender,{$_.Recipients}, InternalMessageID, ClientIP, ClientHostName, ServerIp, ServerHostName, ConnectorID,{$_.RecipientStatus},TotalBytes,RecipientCount,RelatedRecipients,Reference, ReturnPath,Messageinfo | Export-CSV C:\MessageTrackingLog.csv
Inorder to search for the emails from the all the Transport Server in your Exchange Organization use the below shell command
Get-TransportServer | Get-MessageTrackingLog -ResultSize unlimited -Sender “Sender@emailaddress.com” –Recipient “Recipient@emailaddress.com” -Start "MM/DD/YYYY 00:00:00" -End "MM/DD/YYYY 23:59:00"|Select Timestamp, EventId, Source, SourceContext, MessageID, MessageSubject, Sender,{$_.Recipients}, InternalMessageID, ClientIP, ClientHostName, ServerIp, ServerHostName, ConnectorID,{$_.RecipientStatus},TotalBytes,RecipientCount,RelatedRecipients,Reference, ReturnPath,Messageinfo | Export-CSV C:\MessageTrackingLog.csv
We can use the above shell commands in Exchange Server 2010 and Exchange Server 2013

No comments:

Post a Comment