Restore Mailboxes in Exchange Online - aaqibwani/M365 GitHub Wiki
Before diving into restoration, it's essential to understand how Exchange Online handles mailbox deletion:
- 
Soft-Deleted Mailbox: When a user's account is deleted from M365 (cloud only) or AD (on-premises synced), their mailbox enters a 30-day "soft-deleted" state. It's recoverable and can be reconnected to the original or a new user during this period. 
- 
Hard-Deleted Mailbox: After 30 days or if explicitly purged, the mailbox is permanently deleted and generally unrecoverable without a third-party backup. 
- 
Inactive Mailbox: A mailbox placed on Legal Hold or retention policy before user deletion becomes "inactive," preserving its content indefinitely for compliance, bypassing the 30-day soft-delete period. 
- 
Recoverable Items Folder: This acts as a "dumpster" for individual deleted items, allowing user recovery for 14 days (extendable to 30 by admin) before permanent deletion. 
- 
When a user's license or Exchange Online service removed, the mailbox goes into a tombstone mode for 30 days but is not visisble using PowerShell. If the license or Exchange Online service is re-added, the tombstoned mailbox gets reconnected. 
- 
When a user is deleted from M365 Admin or Entra portal, the mailbox is soft-deleted and is visible using PowerShell. To restore such a soft deleted mailbox in Exchange Online, we need to restore the user account within 30 days after which it will be hard deleted (un-recoverable). We cannot connect this to a different user using Connect-Mailbox or restore content to a different mailbox using New-MailboxRestoreRequest unlike in Exchange Server. 
Get-Mailbox -SoftDeletedMailbox <username>
