PowerShell Command for Email Tracking Logs

Gurudas 926 Reputation points
2024-10-09T14:20:22.55+00:00

What PowerShell command can be used to validate the last sent and last received email for 10 mailboxes? Quick assistance would be greatly appreciated!

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,584 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,602 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xintao Qiao-MSFT 3,995 Reputation points Microsoft Vendor
    2024-10-10T07:21:45.5633333+00:00

    Hi, @Gurudas

    From your description, do you want to see the specifics of the last sent and last received emails from multiple mailboxes, or do you want to see when messages were received and sent?

    Are you using Exchange Online or Exchange Server environment?

    Please understand that the Exchange Online tag currently only provides commands for a single mailbox. If you want to see the timestamp of a message, you can try running the Get-MailboxFolderStatistics command with the -IncludeOldestAndNewestItems switch. This will give you the date when the latest emails arrived in your inbox (and subfolders) and sent items folders.

    If you want to implement a query on multiple mailboxes, you can use the above commands as many times as you like or develop related scripts.

    In addition, I'll add the Power Shell tag for you.

    More information can be found Finding the last time stamp of a sent and/or received email with PowerShell? : r/Office365 (reddit.com)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.