In an exchange messaging organizations there is always a need for having a way to report on the Distribution Group Infrastructure's usage (at least based on my experience). Unfortunately Microsoft does not provide an easy way to query when a distribution list was last used as a value of one of its attributes.

in here I have written a powershell script that can be run as scheduled task on a daily basis from any server and does just that (The following)

  1. Established PsSession to one of  your exchange server's Powershell virtual directory. 
  2. make a in message tracking log of every exchange server in  your organization for hits on distribution lists in the past 30 days (Tracking Log keep data for 30 days by default).
  3. It will take that report and after cleaning duplicaates, it takes the latest hit on a distribution list within that 30 days and will stamp it in its CustomAttribute1. 

The Stamp happens based on the following two conditions:

This way you will have a comprehensive way of reporting and determining of when a distribution list was last used. This script needs to run every day based on the last 30 days logs which means:

The script will also send an email report of DLs that are stamp and the error that may have happened. 

I hope i could explain it right :) you can always comment  here or drop me a message in my LinkedIn profile for more question and help. 


How To Use:

The parts of the script that you need to change so fit your organization are:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://ExchangeServerFQDN/PowerShell/" -Authentication Kerberos

 $smtp = ""
$to = ""
$from = ""

where $smtp can be an FQDN of one of your exchange servers or one of your messaging relay servers if you have one. 

Feel free to comment here or for guaranteed response contact me via my LinkedIn Profile.