You want to create mailboxes in Exchange Online and use Office 365. Before you can…
Save sent items in shared mailbox with PowerShell
How to save sent items in shared mailbox sent items folder in Office 365 (Exchange Online) or Exchange on-premises? Users do have send as or send on behalf permissions for shared mailboxes. They do like to save sent items in shared mailbox sent items folder automatically when they sent an email. In this article, you will learn how to enable save sent items in shared mailbox with PowerShell.
The feature is available in Exchange on-premises and Exchange Online. Good to know is that we can enable the feature only with PowerShell in Exchange on-premises. In Exchange Online, we can enable the feature in the Admin Center and with PowerShell. The PowerShell commands are the same for Exchange 2013/2016/2019 (on-premises) and Exchange Online (Office 365).
Table of contents
What’s happening?
The user Amanda got send as permissions to the info shared mailbox.
She will compose an email and send an email from the info mailbox.
The sent message shows up in her Outlook sent items folder; this is the default behavior.
Lets’s check the info shared mailbox sent items folder. We can’t see the message that was sent earlier by Amanda in the shared mailbox. That’s default behavior too.
Most of the time, the shared mailbox is shared with more than one user. What if another user with permissions to that mailbox wants to see what Amanda did send? We want to keep the mailbox organized, tidy, and structured. The better the users can search for these messages in the future.
Solution
To solve this, we can enable the feature copy sent items for the shared mailbox. This way, when Amanda or Richard sent a message, the message will be in their personal sent items folder, and a copy will be saved in the shared mailbox sent items folder. They both will see the messages in the shared mailbox sent items folder.
Connect to Exchange PowerShell
If you want to run the commands to change the settings, connect to Exchange on-premises or Exchange Online:
- Connect to Exchange Online PowerShell
- Run Exchange Management Shell as administrator (Exchange on-premises)
Enable copy items sent as on single mailbox
Get mailbox
1 2 3 4 5 |
[PS] C:\>Get-Mailbox -Identity "info@exoip.com" | Format-Table Name,MessageCopyForSentAsEnabled,MessageCopyForSendOnBehalfEnabled Name MessageCopyForSentAsEnabled MessageCopyForSendOnBehalfEnabled ---- --------------------------- --------------------------------- Info False False |
Enable copy items send as
Enable copy sent items.
1 |
[PS] C:\>Set-Mailbox -Identity "info@exoip.com" -MessageCopyForSentAsEnabled $true |
Verify that it’s working by sending an email from the shared mailbox. The mail shows up in the user mailbox sent items folder.
Let’s have a look at the shared mailbox sent folder. The message shows up.
Enable copy items send on behalf
1 |
[PS] C:\>Set-Mailbox -Identity "info@exoip.com" -MessageCopyForSendOnBehalfEnabled $true |
Enable copy items send as and send on behalf in one command
1 |
[PS] C:\>Set-Mailbox -Identity "info@exoip.com" -MessageCopyForSendOnBehalfEnabled $true -MessageCopyForSentAsEnabled $true |
Enable copy items sent as on all shared mailboxes
Enable the feature for all the shared mailboxes.
Get list of shared mailboxes with feature not enabled
1 2 3 4 5 6 7 |
[PS] C:\>Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails "SharedMailbox" | Where-Object {$_.MessageCopyForSendOnBehalfEnabled -eq $false -or $_.MessageCopyForSentAsEnabled -eq $false} | Format-Table Name,MessageCopyforSentAsEnabled,MessageCopyForSendonBehalfEnabled Name MessageCopyForSentAsEnabled MessageCopyForSendOnBehalfEnabled ---- --------------------------- --------------------------------- Info True False Sales False False HR False False |
Enable copy items send as
1 |
[PS] C:\>Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails "SharedMailbox" | Where-Object {$_.MessageCopyForSentAsEnabled -eq $false} | Set-mailbox -MessageCopyForSentAsEnabled $true |
Enable copy items send on behalf
1 |
[PS] C:\>Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails "SharedMailbox" | Where-Object {$_.MessageCopyForSendOnBehalfEnabled -eq $false} | Set-mailbox -MessageCopyForSendOnBehalfEnabled $true |
Enable copy items send as and send on behalf in one command
1 |
[PS] C:\>Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails "SharedMailbox" | Set-Mailbox -MessageCopyForSentAsEnabled $true -MessageCopyForSendOnBehalfEnabled $true |
Conclusion
In this article, you learned how to save sent items in shared mailbox with PowerShell. Enable the feature with PowerShell and give it a maximum of one hour before the change takes effect. From now on, the sent items will be in the shared mailbox sent items folder.
Did you enjoy this article? You may also like Convert user mailbox to shared mailbox with PowerShell. Don’t forget to follow us and share this article.
This Post Has 0 Comments