Tuesday 25 October 2016

How to export email trace results of Office365 server?

Or, PowerShell command to export email trace of Office365 server.

Descriptions: This is something every Office365 administrators should know. When you perform email trace in office365 server using Web-console, you can’t export the email trace results in to some excel or CSV files if you want. The easiest way to doing it is, you can use Office365 PowerShell command to export the desired mail trace results in to .CSV file.

Connect to office365 server PowerShell admin console with administrative privilege.
Run below command to get the email traces exported in to a CSV file.

Get-MessageTrace -StartDate 10/12/2016 -EndDate 10/13/2016|Export-Csv C:\test.csv

Updated: 23/03/2018

To export Message trace for specific users, you may use the command given below
Get-MessageTrace -SenderAddress "test.user@techiessphere.com" -StartDate 3/20/2018 -EndDate 3/22/2018 | Export-Csv D:\temp\report123.csv

Note: you can change the Start and End date as per your requirements. Also, you can specify the export path as per your convenient.

No comments:

Post a Comment