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

Linus 1 Reputation point
2021-08-24T10:16:58.43+00:00

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@keyman .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

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,386 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,503 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
{count} votes

3 answers

Sort by: Most helpful
  1. KyleXu-MSFT 26,246 Reputation points
    2021-08-25T08:03:15.45+00:00

    @Linus

    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.

    2 people found this answer helpful.

  2. Rich Matheisen 45,906 Reputation points
    2021-08-24T15:13:58.26+00:00

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

    0 comments No comments

  3. Limitless Technology 39,511 Reputation points
    2021-08-25T08:57:12.203+00:00

    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://learn.microsoft.com/en-us/exchange/mail-flow/transport-logs/message-tracking?view=exchserver-2019

    https://learn.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

    0 comments No comments