Setting up Shared Mailbox to save email in sent item folder in O365

When a shared mailbox mapped to outlook and an email sent from the same, email is saved in the sender mailbox sent item, we can set mail to save email to sent item folder in the shared mailbox, by default this feature is disabled in O365, and can be enabled by setting feature enable flag to TRUE:

For emails Sent As the shared mailbox:

POWERSHELL
set-mailbox <mailbox name> -MessageCopyForSentAsEnabled $True

For emails Sent On Behalf of the shared mailbox:

POWERSHELL
set-mailbox <mailbox name> -MessageCopyForSendOnBehalfEnabled $True

If you then want to disable the feature again, you can do it as follows:

For emails Sent As the shared mailbox:

POWERSHELL
set-mailbox <mailbox name> -MessageCopyForSentAsEnabled $False

For emails Sent On Behalf of the shared mailbox:

POWERSHELL
 set-mailbox <mailbox name> -MessageCopyForSendOnBehalfEnabled $False

To enable it on all shared mailboxes:

POWERSHELL
Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'SharedMailbox')} | set-mailbox -MessageCopyForSentAsEnabled $True