In the previous article, we discussed how to install Administrative Template files for Microsoft Office.…
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
[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.
[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
[PS] C:\>Set-Mailbox -Identity "info@exoip.com" -MessageCopyForSendOnBehalfEnabled $true
Enable copy items send as and send on behalf in one command
[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
[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
[PS] C:\>Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails "SharedMailbox" | Where-Object {$_.MessageCopyForSentAsEnabled -eq $false} | Set-mailbox -MessageCopyForSentAsEnabled $true
Enable copy items send on behalf
[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
[PS] C:\>Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails "SharedMailbox" | Set-Mailbox -MessageCopyForSentAsEnabled $true -MessageCopyForSendOnBehalfEnabled $true
Read more: Get shared mailbox size in Office 365 with PowerShell »
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.
Is it possible to change the default value for new mailboxes?
No, it’s not possible.
Hi Ali,
but what if I wanted to save the sent messages only in the sent folder of the shared? What in exchange 2010 was done with the command Set-MailboxSentItemsConfiguration -Identity “SharedMailbox” -SendAsItemsCopiedTo Sender
I use exchange 2016 and the command is no longer valid
thanks in adv
The commands in the article work for Exchange Server 2013/2016/2019 and Exchange Online.
Thanks again for the answer, but with -MessageCopyForSentAsEnabled $true the messages go to the sent folder of the shared and of the user. I need the messages to remain only in the shared mailbox sent folder.With the old command (exch2010) it could be done
Disable (rollback) the save sent items in shared mailbox if you applied that.
Now on a system, test this out:
Add/Edit the following value:
Change “16.0” to your Outlook version.
If everything looks great, deploy the change with a GPO to all the systems.
!nteresting solution.
Thanks again!
How can we do this without using power shell.? Can this be done directly in azure ad/exchange online? Thanks.
You can enable the “copy items sent” settings in Microsoft 365 admin center. But, you can’t select multiple mailboxes and enable the settings. That’s why I recommend PowerShell.
To enable the “copy items sent” settings:
1. Go to the Microsoft 365 admin center
2. Click in the menu on Teams & groups > Shared mailboxes
3. Select the shared mailbox
4. Click under Sent items on Edit
5. Enable the settings
Hi Ali,
Thank you for your professional posts. They are very simple, easy to understand and very useful.
Take care!
Regards
Árpád