Exchange 2016 - Total number of email Sent in a specific range time

A Ska 236 Reputation points
2023-01-25T08:21:48.1466667+00:00

Dears

I'm looking to find the Total number of email Sent in a week.

I finally came to this powershell string:

$msgs=  Get-TransportServer | Get-MessageTrackingLog -Start "01/23/2023 00:00:00" -End "01/23/2023 23:59:59" -ResultSize unlimited | where{$_.EventId -LIKE "SEND*"}
$msgs.count

I checked with my Outlook Sent folder and only by using the SEND* (witch include SEND and SENDEXTERNAL operations) I get the correct number.

This count does not include Calendars invitation acceptance.

What do you think about this script? Any easier solution?

Can you test it and let me know?

Thanks!

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,350 questions
Microsoft Exchange
Microsoft Exchange
Microsoft messaging and collaboration software.
389 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Aholic Liang-MSFT 13,741 Reputation points Microsoft Vendor
    2023-01-26T07:15:28.1+00:00

    Hi @A Ska

    Your command will search for send events for all mailboxes, I recommend adding a sender condition.

    For example:

    $msgs=  Get-TransportServer | Get-MessageTrackingLog -Start "01/23/2023 00:00:00" -End "01/23/2023 23:59:59" -ResultSize unlimited -Sender "user@contoso.com"  | where{$_.EventId -LIKE "SEND*"}
    $msgs.count
    

    Or you can search the total number of sent items by selecting the sent time in the search box in Outlook client:

    1.  click sent items and click search box with option “current folder”

    2.  Click the drop-down list and select the SENT condition (if not, click Add more options to add)

    3.  Then there is an items in the lower left corner of the client, showing the total count.

    enter image description here

    (This will include all outgoing messages, including meeting invitations and rejected messages.)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


  2. Aholic Liang-MSFT 13,741 Reputation points Microsoft Vendor
    2023-01-31T07:58:59.7833333+00:00

    Hi @A Ska

    “Event: DELIVER“ is all mails sent internally and externally, “Event: SENDEXTERNAL” is the email that was successfully sent to the outside. You can get the total and subtract the number of messages sent to the outside to get the number of internal messages.

    Here is a script to get the total number of messages, you can refer to the following:https://learn.microsoft.com/en-us/answers/questions/81779/how-to-check-total-mails(in-and-out)-of-one-month


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    0 comments No comments

  3. A Ska 236 Reputation points
    2023-01-31T13:08:09.8233333+00:00

    Dear,

    Thanks for your reply!

    I tested your solution and got the same results as mine, so I'd say that both options are good!

    Checking SEND* I got 5 messages with EventId SEND AND SENDEXTERNAL

    Checking DELIVER I got the 3 INTERNAL emails

    User's image

    Thanks!