There is one important key to remember
Microsoft 365 Use PowerShell to Recover a Deleted Mailbox
Regardless of how you accidentally deleted someone’s mailbox in Exchange, you can probably recover it using PowerShell (PoSh). The important thing is to do this as soon as you realize the mailbox was deleted.
It’s a heart-stopping moment when we realize that we’ve done this by accident. If you’ve deleted just a few emails, we can show you how to recover deleted emails in Office 365 too.
Before we begin, please note that this is for recovering deleted mailboxes in Exchange Online for the Office 365 environment and Exchange 2010. We will also assume that you have administrator privileges to use the methods described and that you have run some basic PowerShell scripts.