Forum Discussion

Rising Flight's avatar
Rising Flight
Copper Contributor
Dec 24, 2018

outbound email

Hi Experts, i am using exchange hybrid environment.

One of my user has sent an email to external user.The external users says that he did not receive email. how to trace that email has been sent out from my exchange server. do i need to check on my edge servers, please help with powershell syntax.

2 Replies

  • Yes you can track it through Queue Viewer, it is an Microsoft Management Console (MMC)

    https://docs.microsoft.com/en-us/exchange/mail-flow/queues/queue-viewer?view=exchserver-2019

    For Tracking you can use below scripts

    https://docs.microsoft.com/en-us/exchange/mail-flow/transport-logs/search-message-tracking-logs?view=exchserver-2019

    To search the message tracking log entries for specific events, use the following syntax.

    Get-MessageTrackingLog [-Server <ServerIdentity> ] [-ResultSize <Integer> | Unlimited] [-Start <DateTime>] [-End <DateTime>] [-EventId <EventId>] [-InternalMessageId <InternalMessageId>] [-MessageId <MessageId>] [-MessageSubject <Subject>] [-Recipients <RecipientAddress1,RecipientAddress2...>] [-Reference <Reference>] [-Sender <SenderAddress>]

    To view the most recent message tracking log entries on the server, run the following command:

     

    Get-MessageTrackingLog

    This example searches the message tracking logs on the local server for all entries from 3/28/2015 8:00 AM to 3/28/2015 5:00 PM for all FAIL events where the message sender was pat@contoso.com.

     

     

    Get-MessageTrackingLog -ResultSize Unlimited -Start "3/28/2015 8:00AM" -End "3/28/2015 5:00PM" -EventId "Fail" -Sender "pat@contoso.com"

    Use the Exchange Management Shell to control the output of a message tracking log search

    Use the following syntax.

    Get-MessageTrackingLog <SearchFilters> | <Format-Table | Format-List> [<FieldNames>] [<OutputFileOptions>]

    This example searches the message tracking logs using the following search criteria:

    • Return results for the first 1,000 Send events.
    • Display the results in the list format.
    • Display only those field names that begin with Send or Recipient.
    • Write the output to a new file named D:\Send Search.txt

     

    Get-MessageTrackingLog -EventId Send | Format-List Send*,Recipient* > "D:\Send Search.txt"

     

    https://docs.microsoft.com/en-us/exchange/mail-flow/transport-logs/search-message-tracking-logs?view=exchserver-2019

     

     

    Let me know

    • Rising Flight's avatar
      Rising Flight
      Copper Contributor

       

      There are two emails sent to external domain, its from application not from the user. one of the email has been sent to the external domain which i can see from email gateway. but i am not able to see other email.

      I ran the below syntax on my mailbox server but i dont see any failed email with that subject

      $servers | foreach {Get-TransportService -Identity $_ | Get-MessageTrackingLog -sender "appuser@mydomain.com" -ResultSize unlimited -start "12/20/2018 00:00" -end "12/24/2018 23:59" | Where-Object {$_.Eventid -like "*fail*"} | Select-Object sender,messagesubject,@{Name="Recipients";Expression={$_.recipients}},@{Name="RecipientStatus";Expression={$_.recipientstatus}},messageid,timestamp,Eventid,Source,TotalBytes} | Export-Csv C:\output.csv -NoTypeInformation

       

      how can i trace whether the second email has been triggered from the application or not.

      when i use the below syntax on edge server , its not clear becoz i can see lot of emails how can i granularily search whether an email has been sent out from appuser@mydomain.com to xyz@externaldomain.com on edgeserver or please guide me how to troubleshoot.

      Get-ChildItem 'C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Edge\AgentLog\AgentLog20181220*' | Select-String 'appuser@mydomain.com'

Resources