Commands › Exchange Online

Undo-SoftDeletedMailbox

Exchange Online ExchangeOnlineManagement Undo-*

Recover a mailbox that is deleted. Mailboxes can be recovered within 30 days of being deleted.

Quick start script

# Undo-SoftDeletedMailbox — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Undo-SoftDeletedMailbox -SoftDeletedObject <MailboxIdParameter> -PublicFolder <SwitchParameter> | Format-List

# 3. Export for evidence / drift tracking
Undo-SoftDeletedMailbox | Export-Clixml .\SoftDeletedMailbox-$(Get-Date -Format yyyyMMdd).xml

Syntax — 2 parameter sets

PublicFolder

Undo-SoftDeletedMailbox [-SoftDeletedObject] <MailboxIdParameter>
 [-DisplayName <String>]
 [-PublicFolder]
 [-Confirm]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

SoftDeletedMailbox

Undo-SoftDeletedMailbox [-SoftDeletedObject] <MailboxIdParameter>
 [-Password <SecureString>]
 [-WindowsLiveID <WindowsLiveId>]
 [-Confirm]
 [-DisplayName <String>]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-SoftDeletedObject MailboxIdParameter yes The SoftDeletedObject parameter specifies the deleted mailbox to recover. You can use the alias or the email address of the deleted mailbox for the value of this parameter. Use the Get-Mailbox -SoftDeletedMailbox...
-PublicFolder SwitchParameter yes The PublicFolder switch is required to recover public folder mailboxes. You don't need to specify a value with this switch.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DisplayName String The DisplayName parameter specifies the new display name for the recovered mailbox.
-Name String The Name parameter specifies a new value for the Name property of the recovered mailbox. Otherwise, the original value is retained when the mailbox is recovered. The new name value is also used in the...
-Password SecureString The Password parameter specifies a new password for the mailbox.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.
-WindowsLiveID WindowsLiveId The WindowsLiveID parameter specifies a new Microsoft account (formerly known as a Windows Live ID) and primary SMTP address for the mailbox. The previous Microsoft account is retained as a proxy address for the mailbox.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.