Skip to 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 13 Comments

  1. I have enabled copy items sent this but sent email is also visible in sent items of shared mailbox and user mailbox both but user only want it in shared mailbox sent not his personal since email is sent from shared mailbox.

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

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

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

  3. Hi Ali,

    Thank you for your professional posts. They are very simple, easy to understand and very useful.
    Take care!

    Regards
    Árpád

Leave a Reply

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