Commands › Exchange Online
Undo-SoftDeletedMailbox
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)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.