Last time email received by DL

Hello Expert,

I have Exchange 2013 single mailbox+ CAS server role. I have total 300 DL, I would like to find out last email received   time stamp for all DL. could you please help me to get the right script for the same
Manoj BojewarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Simon Butler (Sembee)ConsultantCommented:
That information isn't stored by Exchange or the domain.

The best you can do is query message tracking logs, but as those are only stored for 14 days, the results cannot be depended on.

Manoj BojewarAuthor Commented:
thats fine. i have 30 days logs enable on my servers. even if get report for last 30 days DL last email stamp works for me.

Currently, i am using below command to get individual last email time stamp.

get-messagetrackinglog -recipients "" -resultsize unlimited |select-object recipients,timestamp |sort timestamp -descending
Will SzymkowskiSenior Solution ArchitectCommented:
You just need to wrap this using the foreach command in powershell. Use the below command to accomplish this.

Depending on where you have your distribution group names it will be slightly different.

For TXT list
$DisGroups = get-content "c:\DistributionGroupNames.txt"
ForEach ($Group in $DisGroups) {
get-messagetrackinglog -recipients $Group -resultsize unlimited |select-object recipients,timestamp |sort timestamp -descending 

Open in new window

CSV File Script
$DisGroups = import-csv "c:\DistributionGroupNames.csv"
ForEach ($Group in $DisGroups) {
get-messagetrackinglog -recipients $Group.GroupName -resultsize unlimited |select-object recipients,timestamp |sort timestamp -descending 

Open in new window

You need to construct your CSV file in 1 column using GroupName as the heading.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Manoj BojewarAuthor Commented:
this script is not working. please help me how to run this.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.