A question asks how to remove a bunch of emails from a shared mailbox. You can use OWA to do the job, especially with its Cleanup Mailbox option, but perhaps some administrative action is needed.
Do you need to remove some offensive or otherwise doubtful material from Teams? If the original author won’t do the right thing, the team owner or an Office 365 administrator might have to step in to do the right thing.
Search-Mailbox is a very useful cmdlet but running the cmdlet can be very dangerous as you might end up permanently removing some data that you’d prefer to keep. And in the cloud, there’s no backups…
Office 365 tenant administrators can use different ways to access user data. Shouldn’t you have a policy to govern that access?
The Search-Mailbox cmdlet is very powerful when it comes to removing items from Exchange Online mailboxes, but it can’t deal with other Office 365 content.