When you delete a mailbox, Exchange Online retains the mailbox and all its contents until the deleted mailbox retention period expires, which is 30 days. After 30 days, the mailbox is permanently deleted and can't be recovered. The method for restoring a mailbox depends on whether the mailbox was deleted by deleting the Office 365 user account or removing the Exchange Online license.
Use the Office 365 admin center to restore a user account
If the mailbox was deleted by deleting the corresponding Office 365 user account, you can restore the mailbox by restoring the user account in the Office 365 admin center.
To restore an Office 365 user account Login with global administrator account>users>restore>deleted users.
Use Exchange PowerShell to restore a user account
You can recover soft-deleted mailboxes using the PowerShell cmdlet below. The cmdlet example below restores the mailbox for Allie Bellow.
Connect to Exchange PowerShell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Run the Undo-SoftDeletedMailbox cmdlet.
Undo-SoftDeletedMailbox firstname.lastname@example.org -WindowsLiveID email@example.com -Password (ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force)
For any further clarification or information on topics related to Office365 and email security reach out to us on https://cloud.foetron.com.You can also visit our website Foetron for any assitance on Microsoft related products.