0

Is it possible to return a list of all items a user sent from Outlook on a given day, which includes mails they sent from a Shared Mailbox using 'Send As'? Ideally I'd like to use PowerShell.

Example:

  • User A sends 4 emails from their own User Mailbox
  • User A sends 10 emails from a Shared Mailbox that they have 'Send As' permissions on

I'd want to see a list of 14 emails. However, when I run the code below I only see the 4 emails they sent from their own user mailbox.

Get-MessageTrace -SenderAddress "user@example.com" –Start "2022-01-20 00:00:00" –End "2022-01-20 23:59:59"

It's an Exchange Online hosted solution, not On-Prem. Any help appreciated!

1 Answers1

1

Run below command

Get-Mailbox –ResultSize unlimited | Search-Mailbox -SearchQuery {sent:1/19/2022..1/22/2022 AND from:user2@contoso.com}-TargetMailbox 'administrator@contoso.com' -TargetFolder Inbox -LogOnly -LogLevel Full

This command searches all mailbox for messages that sender is user2 and the sent time form 1/19/2022 to 1/22/2022 ,then logs the result in the SearchAndDeleteLog folder in the administrator's mailbox. Messages aren't copied to the target mailbox.

Aaron
  • 359
  • 4
  • If the issue has been resolved, please mark the helpful replies as answers, this will make answer searching in the forum easier and be beneficial to other community members as well. – Aaron Jan 26 '22 at 09:03