Monday, February 2, 2015

How to check the number of autoreply emails sent from Exchange

In the following guide, we'll show you how to quickly check the number of autoresponder emails sent from your server with a single PowerShell cmdlet.

These statistics might be used to check, whether your office's working hours cover your customer's activity, the amount of traffic that is reaching your absent users and more.

Also with this script you can check how many times the MSH Exchange Autoresponder was triggered.

Start your Exchange Management Console first. Enter the following command in it:

Get-MessageTrackingLog -Start "02/02/2015 18:00:00" -End "03/02/2015 06:00:00" -Subject "Autoreply" -Eventid Send | Measure-Object 

The result is the number of emails, that were sent between 6:00PM 02/Feb/2015 and 6:00AM 03/Feb/2015, and contained the word "Autoreply" in their subject.

Simply replace values of the following parameters to get your own stats:

  • Start - the beginning of the date/time range, where the script looks for matching emails
  • End - the end of the date/time range 
  • Subject - the phrase that the script looks for in the subject field of analyzed messages. For autoreplies it is often the "automatic response" phrase or "Autoreply"
  • Eventid - the state of the message, whether it was sent (Send) from your server, received (Receive) etc. 

The result of the Get-MessageTrackingLog command is additionally "piped", redirected (with the "|" symbol) to the Measure-Object command, which simply counts all the matching messages. Without that command, you would receive a full list of all emails meeting the search criteria.