Total Emails Sent and Received Per Hour

This script counts the number of e-mails that are sent and received in your Exchange environment every day and separated by hour.

4 Star
3,722 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Export mails from a atime range
    1 Posts | Last post December 06, 2018
    • Hello, is it also possible to specify a time range? Example: mails from 01/01.2018 from 12:30 to 14:00 and from 17:00 to 18:00? And then, export for example,  to an excelfile?
  • Total Emails Sent and Received Sizes Per Hour
    2 Posts | Last post April 19, 2018
    • Hi Nuno,
      Is it possible to set the threshold on the Exchange Server or on User to lock down the send emails to 100/minute or 100/5 minutes. Once it reaches the value it should send an alert or can we disable the user itself.
      In our environment users are sending 1000's of emails/Hour. We want to lock down it by keeping some threshold for a user so he cannot send more than 100 emails/minute.
      Looking forward for your response at the earliest.
    • Hi Hari,
      To keep an eye on the number of emails users are sending (on a per-user basis) you will have to use a script similar to this one (or this one: but modified it to give you details per user.
      Once you know the users you want to limit, have a look at "Understanding message rate limits and throttling" (, especially at Throttling Policy and its RecipientRateLimit and MessageRateLimit parameters.
      Hope this helps!
  • Total Emails Sent and Received Sizes Per Hour
    2 Posts | Last post April 24, 2014
    • Hi Nuno,
      is it possible to add a field to show the total per hour on sent and received messages?
    • Hi Guilherme,
      What do you mean exactly? This script already shows the total sent and received e-mails per hour...
      Best regards,
  • Confusion regarding sent/recieve
    2 Posts | Last post January 31, 2014
    • Nuno,
      Our company wanted to see how many e-mails we sent/recieve. I ran in to your script, it does exactly what I want/need. Thanks for that.
      The trigger by what I thougt, whats wrong, is quite easy. We've got a lot(!) of automatisc datacommunication by e-mail. So i've allway's thougt that we would send more, than we recieve..
      But your tool showed me that we recieve the double of what we send. So I take a look in the source. 
      What I've noticed, is when you get the Sent e-mails, you take a look at -EventID - RECEIVE. When you get the Receiver e-mails, you take a look at -EventID -DELIVER.
      It's weird, right? Or am I thinking wrong? Love to hear from you! 
    • Hi Robert,
      I understand your confusion. However, An EventID of RECEIVE with a Source of STOREDRIVER will match e-mails that were sent by users using, for example, Outlook or OWA.
      If you look at the definition of RECEIVE in TechNet (for message tracking), is says: "A message was received by the SMTP receive component of the transport service or from the Pickup or Replay directories (source: SMTP), or a message was submitted from a mailbox to the Mailbox Transport Submission service (source: STOREDRIVER)." As you can see, this is exactly what you want.
      The EventID DELIVER will count every e-mail that was delivered to a user's mailbox. As such, if an internal user sends an e-mail to another internal user, it will count as one e-mail sent and one e-mail received.
      You might also be interested in identical scripts I wrote that count the number of e-mails sent/received by day ( and per week ( and
      Please let me know if this makes sense.
      Best regards,
  • Confusion regarding result
    2 Posts | Last post January 31, 2014
    • dear Nuno,
      I ran the command and got the below mentioned result. Please let me know if it is both sent/receive value since result is not clear. You have mentioned that separate send/receive results will be given but only this result comes out. Your help is required.
    • Dear Jeff,
      Apologies for the long delay in replying to you...
      Is that the exact output you receive? I am sure it is not as it is incomplete... If you look at the code, the script will start by writing to the console:
      Write-Host "`nSent" -ForegroundColor Green
      Followed by the "headers" for the output:
      Write-Host "DayOfWeek,Date,00:00,01:00,02:00,03:00,04:00,05:00,06:00,07:00,08:00,09:00,10:00,11:00,12:00,13:00,14:00,15:00,16:00,17:00,18:00,19:00,20:00,21:00,22:00,23:00" -ForegroundColor Yellow
      And finally the results itself:
      Then, it will do the same for the received e-mails:
      Write-Host "`nReceived" -ForegroundColor Green 
      Write-Host "DayOfWeek,Date,00:00,01:00,02:00,03:00,04:00,05:00,06:00,07:00,08:00,09:00,10:00,11:00,12:00,13:00,14:00,15:00,16:00,17:00,18:00,19:00,20:00,21:00,22:00,23:00" -ForegroundColor Yellow 
      As such, you should be receiving moreon your output...