User Tools

Site Tools


internet:mail:exchange:exchange_track_msg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
internet:mail:exchange:exchange_track_msg [2019/01/15 12:38]
gcooper
internet:mail:exchange:exchange_track_msg [2022/04/17 14:41] (current)
gcooper
Line 1: Line 1:
-====== Using the Exchange Shell to Track Failed Message Delivery ======+====== Using the Exchange Shell to Track Messages ======
  
 [[https://practical365.com/exchange-server/searching-message-tracking-logs-by-sender-or-recipient-email-address/|Exchange Message Tracking from the Command Line]] [[https://practical365.com/exchange-server/searching-message-tracking-logs-by-sender-or-recipient-email-address/|Exchange Message Tracking from the Command Line]]
  
-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.+:!: The ''-match'' comparison operator **does not require** the wildcard character. 
 + 
 +===== Track Failed Message Delivery ===== 
 + 
 +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:** **To track messages that failed because of recipient’s MaxReceiveSize:**
  
 <file> <file>
-Get-MessageTrackingLog -EventID FAIL | where {$_.RecipientStatus -like “*RecipSizeLimit*”}+Get-MessageTrackingLog -ResultSize Unlimited -EventID FAIL | where {$_.RecipientStatus -like “*RecipSizeLimit*”}
 </file> </file>
  
Line 14: Line 18:
  
 <file> <file>
-Get-MessageTrackingLog -EventID FAIL | where {$_.RecipientStatus -like “*SendSizeLimit*”}+Get-MessageTrackingLog -ResultSize Unlimited -EventID FAIL | where {$_.RecipientStatus -like “*SendSizeLimit*”}
 </file> </file>
  
-**To track messages from a particular sender:**+===== Track Messages by Message Subject ===== 
 + 
 +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**. 
 + 
 +<file> 
 +Get-MessageTrackingLog -MessageSubject "Important: Password Expiration Notification" 
 +</file> 
 + 
 +===== Track Messages by Sender =====
  
 <file> <file>
Line 28: Line 42:
 Get-MessageTrackingLog -Sender foo@somedomain.com -Recipients foo@mydomain.com,another@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 -ResultSize Unlimited -Start "01-01-2019" -End "01-15-2019" | where{$_.sender -like "*@senderdomain.tld"| Sort TimeStamp
 </file> </file>
  
-**Find messages by recipient:**+===== Track Messages by Recipient =====
  
 <file> <file>
Line 42: Line 55:
  
 Get-MessageTrackingLog -Start (Get-Date).AddHours(-1) | Where-Object {$_.recipients -match "gmail"} Get-MessageTrackingLog -Start (Get-Date).AddHours(-1) | Where-Object {$_.recipients -match "gmail"}
 +
 +Get-MessageTrackingLog -ResultSize Unlimited -Start "05-19-2019" -End "05-21-2019" -Recipients "recipientaddress@yourdomain.tld" | Sort TimeStamp
 </file> </file>
  
-:!: The ''-match'' comparison operator **does not require** the wildcard character.+===== Track Messages by Message-ID ===== 
 + 
 +<file> 
 +Get-MessageTrackingLog -MessageId "MESSAGE_ID" 
 + 
 +Get-MessageTrackingLog -MessageId "MESSAGE_ID" -Start "05-01-2021" -End "06-03-2021" 
 +</file> 
 + 
 +===== Track Messages by Date and Time ===== 
 + 
 +Last 10 days: 
 + 
 +<file> 
 +Get-MessageTrackingLog -Start (Get-Date).AddDays(-10) -ResultSize Unlimited | Where -Property Recipients -NotLike "*HealthMailbox*
 +</file> 
 + 
 +Specify start and stop: 
 + 
 +<file> 
 +Get-MessageTrackingLog -Start "03/13/2020 09:00:00" -End "03/13/2020 09:10:00" | Where -Property Recipients -NotLike "*HealthMailbox*
 +</file>
internet/mail/exchange/exchange_track_msg.1547581123.txt.gz · Last modified: 2019/01/15 12:38 by gcooper