Tracking messages in the two-CAS environment

Hello!

There are two CAS servers - Exch1 and Exch2, the user connection point - mail.testcompany.com - uses dns round-robin to point either to Exch1 or Exch2. Outbound internet connector resides on Exch1.

User3 connects to https://mail.testcompany.com (this time that was Exch1) and sends two test messages (one of them to the outside receipient). I want to make sure I can find these messages in the logs.

Exch1:

- that's what I'm expecting to  see.

Exch2:


Q1: Why do both exchange servers show these two messages - as far as I get it a single message can't be sent through two servers simulteniously?

Q2: Why does Exchange GUI shows both messages while PS only one?

Thank you in advance,

Michael



  • Edited by MF47 Friday, August 28, 2015 10:23 AM
August 28th, 2015 10:20am

"My guess would be the message that shows the count of 2 is the one with multiple recpeients on it (Subject: TEst1) and the message that says count 1 is the single recpient (Test2)." - yes, theoreticaly this could be, ... but sounds rather strange for me.

But in any case, both Exchange GUI and PS must display the same nubmer of messages - how their figures may differ(Q2)???

Free Windows Admin Tool Kit Click here and download it now
August 29th, 2015 11:00am

You can find multiple records in message tracking log for single email sent/received. And these records may exist in multiple mailbx servers. This is the designed behavior.

  1. If you take a look at the details of the message tracking log records, you'll find they're all different. Basically they refect different actions performed agaist the same email message.
  2. Email is routed by mailbox servers. Depending on the location of sender/recipient, a email message could be processed by multiple mailbox servers.

August 29th, 2015 11:28am

"My guess would be the message that shows the count of 2 is the one with multiple recpeients on it (Subject: TEst1) and the message that says count 1 is the single recpient (Test2)." - yes, theoreticaly this could be, ... but sounds rather strange to me.

But in any case, both Exchange GUI and PS must display the same nubmer of messages - how their figures may differ(Q2)???


  • Edited by MF47 22 hours 28 minutes ago
Free Windows Admin Tool Kit Click here and download it now
August 29th, 2015 2:59pm

"My guess would be the message that shows the count of 2 is the one with multiple recpeients on it (Subject: TEst1) and the message that says count 1 is the single recpient (Test2)." - yes, theoreticaly this could be, ... but sounds rather strange to me.

But in any case, both Exchange GUI and PS must display the same nubmer of messages - how their figures may differ(Q2)???


  • Edited by MF47 Sunday, August 30, 2015 9:01 AM
August 29th, 2015 2:59pm

1, 2 - I agree, but that does not explain "But in any case, both Exchange GUI and PS must display the same nubmer of messages - how their figures may differ(Q2)???"
Free Windows Admin Tool Kit Click here and download it now
August 30th, 2015 10:50am

There is no way to retrieve message tracking log using GUI in Exchange 2013. The one you see is message not message tracking log.
August 30th, 2015 10:13pm

"There is no way to retrieve message tracking log using GUI in Exchange 2013. The one you see is message not message tracking log." - Why do you think so???

http://msexchangeguru.com/2015/03/10/message-tracking/

"Using Shell to view Message Tracking Reports:

We can view the message tracking report using Exchange Management Shell:

Get-MessageTrackingLog

Tracking Message using the Exchange Admin Console (Delivery Reports):

Delivery reports for administrators using the Exchange admin center (EAC) to search message tracking logs of a specific mailbox. We can search for messages sent by or to the mailbox, search a message using subject etc. These delivery reports only has the subject line of the message & we cannot see the body of the message.

We can do the following to track the delivery report:

Go to EAC > Mail Flow ->Click on Delivery Reports => Mailbox."

Regards,

Michael




  • Edited by MF47 22 hours 55 minutes ago
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 4:32am

As you can see in the post, from EAC, what you get is Delivery Report. It's different from message tracking log.

  • Delivery report, tells you which email is delivered and which is not.
  • Message tracking log, tells you every action Exchange server takes against an email message.

You may also notice that delivery report has only 4 columns while message tracking log has 10 times more than that.

Delivery report comes from message tracking log but it's only a subset of it. As I said, if you need to retrieve message tracking log, you have to use EMS.


  • Edited by Li Zhen 21 hours 33 minutes ago
August 31st, 2015 5:55am

"Delivery report comes from message tracking log but it's only a subset of it" - that's the most important fact. Different tools should not yeild various results when using the same database.

I don't need to retrieve a message tracking log, I need to answer (for instance) a very simple question -How many messages have been sent by User3? - using any available means. If the message tracking log itself "answers" - only 1 message - how Delivery Reports that are based on the same logs can show 2 (I don't think the number of columns may influence the result)?

Regards,

Michael

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 6:36am

"There is no way to retrieve message tracking log using GUI in Exchange 2013. The one you see is message not message tracking log." - Why do you think so???

http://msexchangeguru.com/2015/03/10/message-tracking/

"Using Shell to view Message Tracking Reports:

We can view the message tracking report using Exchange Management Shell:

Get-MessageTrackingLog

Tracking Message using the Exchange Admin Console (Delivery Reports):

Delivery reports for administrators using the Exchange admin center (EAC) to search message tracking logs of a specific mailbox. We can search for messages sent by or to the mailbox, search a message using subject etc. These delivery reports only has the subject line of the message & we cannot see the body of the message.

We can do the following to track the delivery report:

Go to EAC > Mail Flow ->Click on Delivery Reports => Mailbox."

Regards,

Michael




  • Edited by MF47 Monday, August 31, 2015 8:33 AM
August 31st, 2015 8:31am

As you can see in the post, from EAC, what you get is Delivery Report. It's different from message tracking log.

  • Delivery report, tells you which email is delivered and which is not.
  • Message tracking log, tells you every action Exchange server takes against an email message.

You may also notice that delivery report has only 4 columns while message tracking log has 10 times more than that.

Delivery report comes from message tracking log but it's only a subset of it. As I said, if you need to retrieve message tracking log, you have to use EMS.


  • Edited by Li Zhen Monday, August 31, 2015 9:55 AM
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 9:54am

If you want message tracking log to answer this question, you have to do some filtering. If your filtering criteria is properly configured, you'll definitely get the same answer as the delivery report.
September 1st, 2015 1:25am

I would suggest you stay with delivery report because there is no simple command can achieve what you want.

  • The outbound (sent) message is logged as event RECEIVE in message tracking log. It may sounds strange to you but this is how it works.
  • With the RECEIVE event, you still can not determine whether it is really delivered to recipient. You have to look for other event, such as FAIL, which may reside in a different mailbox server. You may even need to search for NDR in certain scenario.

  • Edited by Li Zhen Tuesday, September 01, 2015 2:15 PM
Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 2:14pm

Hello all,

Thank you for your replies!

Mark, thank you for the usefull script! When I don't use the keyword "SEND" or "RECEIVE" in the Get-MessageTrackingLog... as you do in your script I have the output showing User3 has sent 8 messages, not  3 (as I sent one more message).

Regarding parsing the log: replacing "SEND" with "RECEIVE" in my script

$Messages = get-messagetrackinglog -server Exch2 -EventID "RECEIVE" -Start (get-date).AddDays(-6) -ResultSize unlimited
$messages | where{$_.sender -like "user3@TestCompany.com"} | select sender | group sender | sort count -Descending | ft count,name

...does not effect the output: PS still displays only one message sent whilst Delivery Reports shows 3 (I has sent one more message to public folder DOCUMENTS), so the question remains: suppose User3 has sent today a couple of messages to 1) User1 2) Administrator using Exch2.

Q) What code may I use to find these messages in the tracking log given that no aforementioned examples had the correct results?

Regards,

Michael




September 2nd, 2015 4:00am

Try this which will get the number of unique messageIDs sent by the user:

$HTServers = "server1","server2"
$startdate = [datetime]::Now.AddDays(-1)
$enddate = [datetime]::Now
$emails = @()
    
$messageSubject = "subject"
$sender = "sender@company.com"
    foreach($HTServer in $HTServers)
        {
            $emails += Get-MessageTrackingLog -Start $startdate -End $enddate -ResultSize Unlimited -Server $HTServer -Sender $sender -MessageSubject $messageSubject
        }

    ($emails | select messageid -Unique).Count

The message tracking logs will log a few events for each email but this should get the unique emails.

Let me know if this answers your question.

Thanks.

Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2015 1:08pm

Thank you very much for the code, Mark!

It differs from my own by the single parameter: -Unique. As soon as I added it to my script the results became the same:

It means a single message can be logged several times within a single server - is there any explanation to this somewhere on techent because this page says nothing about messages recorded more than once ?

https://technet.microsoft.com/en-us/library/Bb124375%28v=EXCHG.150%29.aspx?f=255&MSPPError=-2147217396

And the last question: you, like me, is using parameter "SEND", but Li Zhen said
"The outbound (sent) message is logged as event RECEIVE in message tracking log." - ???

Regards,

Michael



  • Edited by MF47 23 hours 8 minutes ago
September 3rd, 2015 4:19am

"It means a single message can be logged several times within a single server - is there any explanation to this somewhere on techent because this page says nothing about messages recorded more than once ?"

As I mentioned earlier, message tracking log record each and every action Exchange server has taken against an email message. I believe that answers your question.

"And the last question: you, like me, is using parameter "SEND", but Li Zhen said
"The outbound (sent) message is logged as event RECEIVE in message tracking log." - ???"

To be more accurate, you need to filter by event id RECEIVE and source STOREDRIVER. E.g. Get-MessageTrackingLog | ? EventId -eq RECEIVE | ? Source -eq STOREDRIVER. You'll get the email message sent out but it may or may not be delivered to recipient, as I mentioned earlier.


  • Edited by Li Zhen 21 hours 10 minutes ago
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 6:12am

Thank you very much for the code, Mark!

It differs from my own by the single parameter: -Unique. As soon as I added it to my script the results became the same:

It means a single message can be logged several times within a single server - is there any explanation to this somewhere on techent because this page says nothing about messages recorded more than once ?

https://technet.microsoft.com/en-us/library/Bb124375%28v=EXCHG.150%29.aspx?f=255&MSPPError=-2147217396

And the last question: you, like me, is using parameter "SEND", but Li Zhen said
"The outbound (sent) message is logged as event RECEIVE in message tracking log." - ???

Regards,

Michael



  • Edited by MF47 Thursday, September 03, 2015 8:19 AM
September 3rd, 2015 8:18am

"It means a single message can be logged several times within a single server - is there any explanation to this somewhere on techent because this page says nothing about messages recorded more than once ?"

As I mentioned earlier, message tracking log record each and every action Exchange server has taken against an email message. I believe that answers your question.

"And the last question: you, like me, is using parameter "SEND", but Li Zhen said
"The outbound (sent) message is logged as event RECEIVE in message tracking log." - ???"

To be more accurate, you need to filter by event id RECEIVE and source STOREDRIVER. E.g. Get-MessageTrackingLog | ? EventId -eq RECEIVE | ? Source -eq STOREDRIVER. You'll get the email message sent out but it may or may not be delivered to recipient, as I mentioned earlier.


  • Edited by Li Zhen Thursday, September 03, 2015 10:16 AM
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 10:11am

Take a look at the table here: https://social.technet.microsoft.com/Forums/en-US/389ab7a8-0c3a-4eec-a4e7-e771fbfd8078/help-messagetrackinglog-data-differences?forum=exchangesvrsecuremessaging and here: https://technet.microsoft.com/en-us/library/bb124375%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396#EventTypes

It lists the source and eventIDs for the messages and what they refer to. The message tracking logs from PowerShell include all events for each message and this is why the numbers don't match the more simplified output that you see through the GUI which includes only limited information. 

Let me know if this answers your question.

September 3rd, 2015 1:25pm

Yes, this is a very usefull discussion: https://social.technet.microsoft.com/Forums/en-US/389ab7a8-0c3a-4eec-a4e7-e771fbfd8078/help-messagetrackinglog-data-differences?forum=exchangesvrsecuremessaging

Thank you all for your help!

Regards,

Michael

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 3:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics