Learn Exchange the Guru way !!!


Find users who sent emails to one specific domain

This is a quick one. This cmdlet will help you search the message tracking logs on the hub transport server to see who send emails to external email domains.

Set $FormatEnumerationLimit to -1 following this

Edit properties of Powershell window to width = 120 and height = 500

Run the following cmdlet:

Get-MessageTrackingLog -resultsize unlimited |where-object {$_.Recipients -like “*, *” -AND $_.EventId -eq “Send”} |ft -auto >>C:\External mails.txt


Ratish Nair
MVP Exchange
Team@ MSExchangeGuru

Search Message Tracking Logs, Who sent email to a particular domain, track external emails in exchange

6 Responses to “Find users who sent emails to one specific domain”

  1. Muthu Says:

    Is that anythung availble in e2k3.

  2. Muzz Says:

    Excellent – just tested this and it works very well!, it helps to use the tracking log explorer to generate a EMS command and determine the required parameters and adjust the cmdlet to taste.

  3. Imtiaz Says:

    Not working in Exchange 2007 with sp1.

  4. Dave Says:

    Works great in Exchange 2010. But an even better way to export the report is like this:
    Get-MessageTrackingLog -resultsize unlimited | where-object {$_.Recipients -like “*, *” -AND $_.EventId -eq “Send”} | ConvertTo-Csv > “C:\Maillog.csv”

    By exporting directly to CSV, it includes even more details, is easier to review the data in Excel, and also eliminates the need to modify the properties of the Powershell window width.

  5. Atul Says:

    not working on Exchange 2010 + SP3.

  6. Prabhat Nigam Says:

    Run in the Exchange management shell.

Leave a Reply

migrate exchange to office 365