Email Tracking Log in Exchange Server

Email Tracking Log in Exchange Server

June 15, 2020

Get-MessageTrackingLog is a powershell comand we can use to track the email log on Exchange.
If you have the needs to get the email log, these command may help you.

Find emails log from a particular sender in the last hour:

Get-MessageTrackingLog -Sender [email protected] -Start (Get-Date).AddHours(-1) 

Find emails log and filter based on sender domain:

get-messagetrackinglog | where {[string]$_.recipients -like "*@domain.com"}

Find all emails log from a particular sender between a certain time period:

get-messagetrackinglog -sender test.domain.com -Start "02/24/2019 09:00:00" -End "02/25/2019 17:00:00" | ft Timestamp, Source, Sender, Recipients, MessageSubject

Find all emails log in specific time period and mails sent to any user under “domain.com” domain:

Get-MessageTrackingLog -ResultSize Unlimited -Start "02/24/2019" -End  
"02/25/2019" | where {$_.recipients –like "*@domain.com"} | select-object Timestamp,SourceContext,Source,EventId,MessageSubject,Sender,{$_.Recipients}

The Get-MessageTrackingLog results are displayed on-screen. You can write the results to a file by piping the output to ConvertTo-Html or ConvertTo-Csv and adding “> ” to the command.

For Example you want to export the result of emails log from a particular sender in the last hour:

Get-MessageTrackingLog -Sender [email protected] -Start (Get-Date).AddHours(-1) | export-csv C:tempMessageTrackingLogResults.csv 

Leave a Comments

Your email address will not be published. Required fields are marked *

Copyright ©2023 All rights reserved