keepcalculator

06 Numbers and Powers

Restore a Deleted Exchange Mailbox with PowerShell

Card No. 06·25429 · Updated · Standard formula, shown below

You can restore a deleted Exchange mailbox with PowerShell if its mailbox data is still retained and the account or mailbox meets the requirements for reconnection. In Exchange Online, the usual route is to reconnect a soft-deleted mailbox to an existing user; in Exchange Server, you can reconnect it to an Active Directory account or restore it from a recovery database.

First identify what “deleted” means

Exchange does not always erase mailbox data immediately when an account or mailbox is deleted. A mailbox may be soft-deleted, meaning it is disconnected but retained for a period, or it may be inactive, preserved under a retention or hold policy after its associated user account is removed. A mailbox whose retention period has expired, or whose data was permanently purged, cannot be recovered with a simple reconnect command.

The recovery method depends on where the mailbox is hosted and what action removed it. Exchange Online and on-premises Exchange use different management connections and commands. Before changing anything, determine the mailbox identity, deletion time, and whether the corresponding user account still exists.

  • Exchange Online: use Exchange Online PowerShell and check for a soft-deleted mailbox. A disconnected mailbox can generally be connected to a suitable existing user account while it remains available.
  • Exchange Server: use the Exchange Management Shell. A disconnected mailbox can be reconnected to an Active Directory user, subject to the database and retention state.
  • Inactive mailbox: this is a retention-preserved mailbox, not an ordinary mailbox awaiting reconnection. Use the organization’s compliance and restore process rather than treating it as a standard soft-deleted mailbox.

Before you run PowerShell

Use an account with the Exchange permissions needed to view recipients and perform mailbox operations. For Exchange Online, install or use the supported Exchange Online PowerShell module, then connect to the tenant with an appropriately authorized administrator account. For on-premises Exchange, open the Exchange Management Shell on a server or use a correctly configured remote session.

Start with read-only checks. Confirm the mailbox’s primary SMTP address, alias, display name, and, when available, its Exchange GUID. Names can be duplicated, and an email address alone may not uniquely identify the right object. Check that the target user is the intended person and that the mailbox is not already connected.

Record relevant details before making changes. If the mailbox is important, confirm retention, litigation hold, backup, and organizational recovery requirements with the Exchange administrator. Avoid deleting or recreating accounts as a guess: doing so can complicate matching mailbox data to the correct identity.

Restore a soft-deleted Exchange Online mailbox

Connect to Exchange Online PowerShell, then look for the mailbox among soft-deleted mailboxes. A typical query is:

Get-Mailbox -SoftDeletedMailbox -Identity user@contoso.com

If the query returns the expected mailbox, note its Exchange GUID and verify that the intended user account exists and is properly licensed as required by the tenant’s configuration. A common recovery approach is to connect the soft-deleted mailbox to that existing user with Undo-SoftDeletedMailbox:

Undo-SoftDeletedMailbox -Identity <mailbox-guid> -WindowsLiveID user@contoso.com -Password (Read-Host -AsSecureString)

Replace the placeholder with the mailbox’s actual GUID and use the correct sign-in address for the target user. PowerShell prompts for a secure password in this example; follow your organization’s account and identity-management process rather than choosing credentials casually. Command parameters and availability can vary with the mailbox state and management environment, so check the command’s current help if PowerShell reports an unsupported parameter.

After the operation, verify the result instead of assuming it succeeded:

Get-Mailbox -Identity user@contoso.com

Then check that the expected mailbox is present, the address and identity are correct, and the user can access it after directory and service changes have completed. A restore is not necessarily instantaneous.

Reconnect a mailbox in Exchange Server

In on-premises Exchange, first find disconnected mailboxes in the relevant mailbox database:

Get-MailboxStatistics -Database

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →