skip to Main Content

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).

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.

Save sent items in shared mailbox with PowerShell sent items before

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.

Save sent items in shared mailbox with PowerShell sent items shared mailbox before

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:

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.

Save sent items in shared mailbox with PowerShell sent items after

Let’s have a look at the shared mailbox sent folder. The message shows up.

Save sent items in shared mailbox with PowerShell sent items shared mailbox after

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.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top