Exchange Distribution List's Last Usage Time Stamp

Riaz Alexander AnsaryEnterprise Infrastructure Systems Engineer
CERTIFIED EXPERT
Published:
Edited by: Andrew Leniart
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 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 duplicates, 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:


  • If the CustomAttribute1 value is empty
  • If the CustomAttribute1 value is older than the recent hit pulled from tracking logs


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


  • Any distribution list that has no value of CustomAttribute1 has not been used in the past 30 days
  • As time goes the date stamp of CustomAttribute1 keeps showing last used vs 30 days plus 1. For example, if you check a customattribute1 value of a distribution list the next day after you scheduled it to run it shows the last usage in the past 31 days and same goes to no value, which shows the Distribution list has not been used in the past 31 days.


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

I hope I have explained it right :) 


You can always comment here or drop me a message in my Experts Exchange Profile for more question and help. 


You can also Download the script from Technet Gallery

https://gallery.technet.microsoft.com/office/Exchange-Distribution-a8095f75


Hope this article has helped you out.

0
2,993 Views
Riaz Alexander AnsaryEnterprise Infrastructure Systems Engineer
CERTIFIED EXPERT

Comments (1)

Is there a way to extend the 30 days or is that it?

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.