SOLVED: How to Determine if a Distribution List Is Being Used in Exchange

If you are like most companies, when staff leave you delete their email accounts but you likely don’t give much thought to the Distribution Lists that they used.  After a few years you can have quite a few unused Distribution Lists which does not do anyone good so you should remove them.  However, your likely afraid to just dump them based on your intuition that they are unused and so you need some numbers to prove they are dead.  Below are several ways to determine what Distribution Lists are used or unused in Exchange PowerShell.

How to Output the Date, Distribution List Name and Subject in Exchange:

The following command will push out an unsorted list (which you can sort in Excel) to C:\TEST.TXT of all emails sent to a distribution list after August 16, 2015.  You could export all of the Distribution List

Get-MessageTrackingLog -Start 08/16/2015 -ResultSize 99999 -EventID Expand | ft Timestamp,RelatedRecipientAddress,MessageSubject -Autosize >c:\test.txt

How to Count all of the Messages sent to a Particular Distribution List  in Exchange:

The following command will display a count of emails sent to a single email address from August 1 2015 at to September 1 2015.  That address can be a distribution list.

Get-MessageTrackingLog -start “08/01/2015 12:00:00” -End “09/01/2015 12:00:00” -Recipients “imatthews@arcis.com” -ResultSize 99999 | measure-object

For more information, you may find the following articles useful (I know I did):

http://blogs.technet.com/b/messaging_with_communications/archive/2011/04/22/how-to-track-message-in-exchange-2003-2007-2010.aspx

http://exchangepedia.com/2009/02/are-distribution-groups-really-being-used.html

http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_27865113.html

View Comments

  • Thanks for the help.. Changed it a bit and got an excel sheet..

    [PS] C:\Windows\system32>Get-MessageTrackingLog -Start 02/09/2020 -ResultSize 99999 -EventID Expand | Select-Object Timestamp,Sender,RelatedRecipientAddress,MessageSubject | export-csv d:\test.csv

  • In case anyone runs across this article in the future, I found a slight error with the above code. If you are looking for the count of emails to a distribution list, you'll want to narrow the search down to a specfic eventid. The above code will report back with a number much higher than is correct because the Tracking Log has entries for each step in the mail flow process (e.g. TRANSFER, SEND, DELIVER). A better solution would be the follow:

    Get-MessageTrackingLog -start “08/01/2015 12:00:00” -End “09/01/2015 12:00:00” -Recipients “imatthews@arcis.com” -ResultSize 99999 | Where EventId -eq 'DELIVER' | Measure-Object

Published by
Ian Matthews

This website uses cookies.