Commands › Exchange Online

Restore-Mailbox

Exchange Online ExchangeOnlineManagement Restore-*

Extract mailbox content from a restored database. **Note**: In Exchange Server 2010 Service Pack 1 (SP1) or later, use the New-MailboxRestoreRequest cmdlet instead of the Restore-Mailbox cmdlet to extract mailbox content from a restored database.

Quick start script

# Restore-Mailbox — 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
Restore-Mailbox -Identity <MailboxIdParameter> -RecoveryDatabase <DatabaseIdParameter> -RecoveryMailbox <StoreMailboxIdParameter> | Format-List

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

Syntax

Restore-Mailbox [-Identity] <MailboxIdParameter> -RecoveryDatabase <DatabaseIdParameter> -RecoveryMailbox <StoreMailboxIdParameter> -TargetFolder <String>
 [-AllowDuplicates]
 [-AllContentKeywords <String[]>]
 [-AttachmentFilenames <String[]>]
 [-BadItemLimit <Int32>]
 [-Confirm]
 [-ContentKeywords <String[]>]
 [-EndDate <DateTime>]
 [-ExcludeFolders <MapiFolderPath[]>]
 [-GlobalCatalog <Fqdn>]
 [-IncludeFolders <MapiFolderPath[]>]
 [-Locale <CultureInfo>]
 [-MaxThreads <Int32>]
 [-RecipientKeywords <String[]>]
 [-SenderKeywords <String[]>]
 [-StartDate <DateTime>]
 [-SubjectKeywords <String[]>]
 [-ValidateOnly]
 [-WhatIf]
 [<CommonParameters>]

Parameters (22)

ParameterTypeRequiredWhat it controls
-Identity MailboxIdParameter yes The Identity parameter specifies the mailbox that you want to restore. You can use any value that uniquely identifies the mailbox. For example:
-RecoveryDatabase DatabaseIdParameter yes The RecoveryDatabase parameter specifies the recovery database where you are restoring the mailbox from. You can use any value that uniquely identifies the database. For example:
-RecoveryMailbox StoreMailboxIdParameter yes The RecoveryMailbox parameter specifies the mailbox to be used as the source mailbox. This parameter is required if the source mailbox is different from the target mailbox.
-TargetFolder String yes The TargetFolder parameter specifies the mailbox folder that's created on the mailbox specified. This parameter is required if the mailbox being restored is different from the target mailbox. (For example, the value...
-AllowDuplicates SwitchParameter The AllowDuplicates switch copies mail items without checking if they're duplicates of existing items and without removing duplicate items. You don't need to specify a value with this switch.
-AllContentKeywords String[] The AllContentKeywords parameter specifies the filters for all of the following:
-AttachmentFilenames String[] The AttachmentFilenames parameter specifies the filter for the attachment file name. You can use wildcard characters in the string. For example, you can use \*.txt to export items that have a .txt extension.
-BadItemLimit Int32 The BadItemLimit parameter specifies the number of corrupted items in a mailbox to skip before the export operation fails.
-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.
-ContentKeywords String[] The ContentKeywords parameter specifies the keyword filters for the message body and content of attachments in the source mailbox.
-EndDate DateTime The EndDate parameter specifies the end date for filtering content to be exported from the source mailbox. Only items in the mailbox whose date is prior to the end date are exported. When you enter a specific date,...
-ExcludeFolders MapiFolderPath[] The ExcludeFolders parameter specifies the list of folders to exclude during the export. Folders are excluded as they're entered. They aren't localized. For example, excluding calendar only excludes calendar in...
-GlobalCatalog Fqdn The GlobalCatalog parameter specifies the global catalog to use to search for the target mailbox.
-IncludeFolders MapiFolderPath[] The IncludeFolders parameter specifies the list of folders to include during the export. Folders are included as they're entered. They aren't localized. For example, including calendar only includes calendar in...
-Locale CultureInfo The Locale parameter specifies the locale setting on a message to restore. With this filter set, only messages with the specified locale setting are extracted.
-MaxThreads Int32 The MaxThreads parameter specifies the maximum number of threads to use.
-RecipientKeywords String[] The RecipientKeywords parameter specifies the keyword filters for recipients of items in the source mailbox. This filter finds the search string even if it's part of a word. This isn't a whole word search.
-SenderKeywords String[] The SenderKeywords parameter specifies the keyword filters for senders of items in the source mailbox. This filter finds the search string even if it's part of a word. This isn't a whole word search.
-StartDate DateTime The StartDate parameter specifies the start date. The start date must be before the end date.
-SubjectKeywords String[] The SubjectKeywords parameter specifies the keyword filters for subjects of items in the source mailbox. This filter finds the search string even if it's part of a word. This isn't a whole word search.
-ValidateOnly SwitchParameter The ValidateOnly switch specifies whether to evaluate the potential success or failure of the command without making changes. You don't need to specify a value with this switch.
-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.

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