question

Linus-3228 avatar image
0 Votes"
Linus-3228 asked emilyhua-msft edited

Check to see the date of the last email sent or received to a distribution mailbox?

Hello,

I’m trying to find when was the last email sent or received to a distribution mailbox in exchange server 2016.

Active directory is populated with an unholy amount of mailboxes and distribution mailboxes. Is there a way to check if any of these are inactive/not used?

For example, if an email hasn’t been sent or received to/from that mailbox in the last 90 days, what would be the quickest way to find out this data?

Right now I have the below:

Search-Mailbox -SearchQuery {from:emailadressname@domain.com AND Received:"05/24/2021 10:00..08/24/2021 13:00"}

I’m open to hearing other ways of getting this data if there is any better solutions

Thank you in advance

windows-server-powershelloffice-exchange-server-administrationoffice-exchange-online-itpro
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Linus-3228
I am writing here to confirm with you any update about this thread now?
If the suggestion below helps, please be free to mark it as an answer for helping more people.

0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello,

Thank you for your question..

I would like to suggest you to check Message Trace from Exchange admin Center.
you need provide Distribution group email address to check if the emails are delivered or not.

Alternatively please have a look on below Microsoft article related to Message tracking and tracing.

https://docs.microsoft.com/en-us/exchange/mail-flow/transport-logs/message-tracking?view=exchserver-2019

https://docs.microsoft.com/en-us/answers/questions/131210/message-tracking-log-for-distribution-group-emails.html

If the reply was helpful, please don’t forget to upvote or accept as answer.

Thanks,

PRAKASH T

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered RichMatheisen-8856 commented

@Linus-3228

You can also use Get-MessageTrackingLog command to check the latest email that sent to group and received from group:

The latest email that sent to group:

 Get-TransportService | Get-MessageTrackingLog -Recipients Group1@domain.com -EventId RECEIVE -Source SMTP | Sort-Object Timestamp -Descending | select Timestamp,Sender,MessageSubject -First 1

The latest email that receive from group:

 Get-TransportService | Get-MessageTrackingLog -Sender Group1@domain.com -EventId send -Source SMTP | Sort-Object Timestamp -Descending | select Timestamp,Sender,MessageSubject -First 1

Please note that the Message Tracking log can only record logs within 30 days:

 Get-TransportService | fl MessageTrackingLogMaxAge

If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Those would be a HUGE set of log files to encompass 90 days of message logging!

If the logs were processed (for example) daily and the most recent date of all messages sent/received by a mailbox recorded in either a flat file or database the process could easily be automated and questions like the one posed by the OP answered quickly.

Commercial software is available to monitor/measure the acquisition/analysis of Exchange server. Writing your own is possible, too -- but you need to know what questions you'll want answered first!

0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered

I'm not sure if this will do it for you, but give it a try: Get-MailboxFolderStatistics

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.