Score:0

Powershell to List Sent Items From Shared Mailbox by User

ru flag

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 "[email protected]" –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!

Score:1
cn flag

Run below command

Get-Mailbox –ResultSize unlimited | Search-Mailbox -SearchQuery {sent:1/19/2022..1/22/2022 AND from:[email protected]}-TargetMailbox '[email protected]' -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.

cn flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.