Summarizing Message Tracking Logs

Summarizing Message Tracking Logs

Exchange does a great job at logging all kinds of information, some by default and some can be switched on or extended. One example of this is the Exchange Message Tracking Logs. These logs can get large and analysing the data can be a bit of a chore. Some of the questions we are often asked are:

  • How much mail is going through this Exchange server?
  • What is the average mail size?
  • What is the percentage of daily mail sent each hour?
  • What is the largest message sent today?
  • Why was there are message queue between 3 and 4pm today?

All of this information is in the Message Tracking Logs, but getting the information out is sometimes a little trickier. Luckily PowerShell has some great Exchange cmdlets to help us out.

The attached script takes two parameters, the name of the server and the date to do the analysis for. It creates a csv file in your My Documents folder called MessageStats-ServerName-Date.csv.

Within this file the following columns are available:

Column NameDescription
ServerThe name of the server that these statistics are for
HourThe hour of the day that these statistics are for
ConnectorIdThe name of the Send or Receive connector
MessageCountOutThe number of messages sent from this server
MessageCountInThe number of messages sent to this server
TotalBytesOutThe total number of bytes sent from this server
TotalBytesInThe total number of bytes sent to this server
AverageBytesOutThe average bytes per message sent from this server
AverageBytesInThe average bytes per message sent to this server
MinimumBytesOutThe smallest message sent from this server
MinimumBytesInThe smallest sent to this server
MaximumBytesOutThe largest message sent from this server
MaximumBytesInThe largest message sent to this server

Open the csv file in Excel and suddenly you can do all kinds of smart graphs, pivot tables and filters to answer not only the above questions, but many more beyond that.

We hope that this will help others in their endeavours with Microsoft Exchange!

*** As always the script is provided on an as is basis, please test it before you use it in a production environment. ***

Get-MessageStatistics.ps1