We help IT Professionals succeed at work.

Exporting Message Tracking Log

mrosier
mrosier asked
Hello! I am running the below cmdlet in the Exchange Shell. The resulting CSV file does not contain recipient email address though. If I run it without the export command, the results display the recipient email address. Can someone tell me how to get that address in the exported file though?

Get-MessageTrackingLog -ResultSize Unlimited -eventid "Submit" -Start "3/17/2020 12:00AM" -End "3/28/2020 5:00PM" -Sender "user@example.com" | export -csv c:\messagelogsent.csv
Comment
Watch Question

Software Developer
CERTIFIED EXPERT
To include recipient info in the csv, you need to do a little trick:
Get-MessageTrackingLog -ResultSize Unlimited -eventid "Submit" -Start "3/17/2020 12:00AM" -End "3/28/2020 5:00PM" -Sender "user@example.com" | Select-Object sender,@{Name="Recipients";Expression={$_.recipients}},@{Name="RecipientStatus";Expression={$_.recipientstatus}},messagesubject,totalbytes,eventid,messageinfo,messagelatency | export -csv c:\messagelogsent.csv
To learn more, check out Message tracking logs in Exchange Server