I'm managing a shared mailbox in Exchange Online and I want to set it up so that anything older than a week in the Sent Items folder gets deleted automatically. I've tried various methods, but they don't seem to work anymore. I'm starting to think I need to use Microsoft Graph, but I really have no idea how that would work. If anyone could point me to a straightforward guide, I would really appreciate it!
Also, just an update: I found out that it was actually those old methods that were still valid, especially the legacy settings in Purview.
4 Answers
So you did try a retention policy and it didn’t work? Can you share what happened?
The classic MRM retention policy method still functions for Exchange Online. Set up a retention tag to delete items after a week, apply it to the Sent Items folder using a retention policy, and then assign that policy to the shared mailbox. You can manage all this in the Exchange admin center under Compliance > Retention, or even through PowerShell commands. Microsoft Graph is there if you want to do it programmatically, but MRM is so much simpler for scheduled cleanups without custom code.
You can manage retention tags through the Security or Purview dashboard, and there’s a preset option for deleting items after a certain time as well.
The easiest way to handle this if you're using Exchange Online is by setting up a retention policy instead of diving into Microsoft Graph. You can create a retention tag that automatically deletes items in the Sent Items folder after seven days. Just scope that tag specifically to Sent Items, then include it in a retention policy and assign it to your shared mailbox. Once it's applied, the Managed Folder Assistant will take care of cleaning up old items. No coding required! We've had success with this method for shared mailboxes that send a lot of messages, just keep in mind that cleanup isn't instantaneous—it depends on when the assistant runs.
I didn’t see an option to limit the retention tag to just one folder. But I ended up figuring it out through the legacy settings anyway!

That’s great to hear! I didn't realize those legacy settings would come to the rescue.