Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are using Exchange 2010. I would like to retrieve a list of total sent emails and received emails from all users in the work place for 30 days. The list should have all the users' names, then total of sent and received emails.

I have tried the example code below and tried to change this to no avail.

Get-MessageTrackingLog -Recipients -start “10/22/2011 00:00:00” -end “11/21/2011 11:59:00” -EventId "receive" | measure-object

Get-MessageTrackingLog -sender -start “10/22/2011 00:00:00” -end “11/21/2011 11:59:00” -EventId "send" | measure-object

share|improve this question
Take a look and see if there are WMI counters for this. It might get reset when the services restart though. I doubt there is any kind of lifetime counter. – SpacemanSpiff Oct 5 '12 at 14:30
up vote 5 down vote accepted

"By default, the maximum age for any message tracking log file is 30 days" - unless you've changed the message tracking log defaults, you are very unlikely to get a year old data from there (unless you have had virtually no messages so the 10 MB per log file limit has not been hit more than 30 days in the past).

If you need this kind of data to persist, change the maximum age / directory size limit for the logs as described in the docs.

Another point is that the tracking log does not contain user information - it just contains senders and recipients - which might or might not map to actual users of your infrastructure.

Other than that, you could just pipe the result of Get-MessageTrackingLog to group-object for grouping and counting. For grouping by senders, this would be rather trivial:

Get-MessageTrackingLog -start “10/22/2011 00:00:00” -end “11/21/2011 11:59:00” | group-object -Property Sender

Grouping by recipients is trickier as the "Recipients" field returned by Get-MessageTrackingLog is multivalued - i.e. could contain more than one recipient. Prepending a Select-Object -ExpandProperty helps here:

Get-MessageTrackingLog -start “10/22/2011 00:00:00” -end “11/21/2011 11:59:00” | select-object -ExpandProperty Recipients | group-object

The result set is going to look somewhat like this:

Count Name                      Group
----- ----                      -----
   44       {,, ...}
   11      {,, ...}
   36 some.address@foreigndo... {, some.address@for...}
share|improve this answer
Hi, Sorry that was just an example code that I tried to use. We need a month's worth of data. – Matt Oct 8 '12 at 7:22
@Matt I've added some information - check out if this is likely to help you. – the-wabbit Oct 8 '12 at 12:26

Not sure what you are looking for (still), as I am unsure where you are with the question and how much the comments have helped you so far but, the following script helped me all the way:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.