This is an old revision of the document!
Exchange Message Tracking from the Command Line
The
-match
comparison operator does not require the wildcard character.
You can use the Exchange shell to track messages that could not be delivered because of message size issues. The RecipientStatus
field in Message Tracking logs is used to store the SMTP response and enhanced status codes. The Message Tracking EventID we’re looking for is FAIL.
To track messages that failed because of recipient’s MaxReceiveSize:
Get-MessageTrackingLog -EventID FAIL | where {$_.RecipientStatus -like “*RecipSizeLimit*”}
To track messages that failed because of the sender’s MaxSendSize:
Get-MessageTrackingLog -EventID FAIL | where {$_.RecipientStatus -like “*SendSizeLimit*”}
https://practical365.com/exchange-server/searching-message-tracking-logs-by-email-subject/
This command returns partial match results, so there is no need for wildcard searches.
Get-MessageTrackingLog -MessageSubject "Important: Password Expiration Notification"
Get-MessageTrackingLog -sender "foo@somedomain.com" Get-MessageTrackingLog -Sender foo@somedomain.com -Start (Get-Date).AddHours(-1) Get-MessageTrackingLog -Sender foo@somedomain.com -Recipients foo@mydomain.com Get-MessageTrackingLog -Sender foo@somedomain.com -Recipients foo@mydomain.com,another@mydomain.com Get-MessageTrackingLog -ResultSize Unlimited -Start "01-01-2019" -End "01-15-2019" | where{$_.sender -like "*@senderdomain.tld"}
Get-MessageTrackingLog -Recipients "foo@mydomain.com" Get-MessageTrackingLog -Recipients *@gmail.com Get-MessageTrackingLog -Start (Get-Date).AddHours(-1) | Where-Object {$_.recipients -like "*@gmail.com"} Get-MessageTrackingLog -Start (Get-Date).AddHours(-1) | Where-Object {$_.recipients -match "gmail"}