Edit

Share via


Restore-Mailbox

This cmdlet is available only in Exchange Server 2010.

Use the Restore-Mailbox cmdlet to 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.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.

Syntax

Default (Default)

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>]

Description

The Restore-Mailbox cmdlet copies end-user data from any server running Microsoft Exchange Server 2010 to a mailbox on an Exchange 2010 Mailbox server in the same organization that has adequate space and resources to support the mailbox. The Restore-Mailbox cmdlet can only use disconnected mailboxes on a server as a source of data, and the cmdlet can only use connected mailboxes as a target for data.

You need to be assigned permissions before you can run this cmdlet. Although this article lists all parameters for the cmdlet, you might not have access to some parameters if they aren't included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see Find the permissions required to run any Exchange cmdlet.

Examples

Example 1

Restore-Mailbox -Identity Scott -RecoveryDatabase MyRecoveryDatabase

This example restores a mailbox for user Scott from the database MyRecoveryDatabase.

Example 2

Restore-Mailbox -Identity Scott -RecoveryDatabase MyRecoveryDatabase -RecoveryMailbox John -TargetFolder Recovery

This example restores John's mailbox content into Scott's mailbox under the Recovery folder.

Example 3

Restore-Mailbox -Identity Scott -RecoveryDatabase MyRecoveryDatabase -SubjectKeywords "Meeting" -ContentKeywords "business" -IncludeFolders \Inbox,\Calendar

This example restores only the mail with the subject Meeting, with the message body containing the word business, and with the message location either in the Inbox or Calendar folder. This example assumes that the mailbox is in English.

Example 4

Get-Mailbox -Database MyDatabase | Restore-Mailbox -RecoveryDatabase MyRecoveryDatabase

This example bulk restores all the mailboxes in the MyDatabase mailbox database that are also present in MyRecoveryDatabase.

Parameters

-AllContentKeywords

Applicable: Exchange Server 2010

The AllContentKeywords parameter specifies the filters for all of the following:

  • Subject
  • Message body
  • Attachment content

This allows an OR search of all these fields. If your search criteria are part of the subject, message body, or attachment content, you get results.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AllowDuplicates

Applicable: Exchange Server 2010

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.

We recommend that you use this switch with the IncludeFolders parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AttachmentFilenames

Applicable: Exchange Server 2010

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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-BadItemLimit

Applicable: Exchange Server 2010

The BadItemLimit parameter specifies the number of corrupted items in a mailbox to skip before the export operation fails.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Applicable: Exchange Server 2010

The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on if the cmdlet requires confirmation before proceeding.

  • Destructive cmdlets (for example, Remove-* cmdlets) have a built-in pause that forces you to acknowledge the command before proceeding. For these cmdlets, you can skip the confirmation prompt by using this exact syntax: -Confirm:$false.
  • Most other cmdlets (for example, New-* and Set-* cmdlets) don't have a built-in pause. For these cmdlets, specifying the Confirm switch without a value introduces a pause that forces you acknowledge the command before proceeding.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ContentKeywords

Applicable: Exchange Server 2010

The ContentKeywords parameter specifies the keyword filters for the message body and content of attachments in the source mailbox.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EndDate

Applicable: Exchange Server 2010

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, use the short date format defined in the Regional Options settings configured on the local computer. For example, if your computer is configured to use the short date format MM/dd/yyyy, enter 03/01/2010 to specify March 1, 2010.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludeFolders

Applicable: Exchange Server 2010

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 English because calendar in other languages is a different word.

Parameter properties

Type:

MapiFolderPath[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GlobalCatalog

Applicable: Exchange Server 2010

The GlobalCatalog parameter specifies the global catalog to use to search for the target mailbox.

Parameter properties

Type:Fqdn
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Identity

Applicable: Exchange Server 2010

The Identity parameter specifies the mailbox that you want to restore. You can use any value that uniquely identifies the mailbox. For example:

  • Name
  • Alias
  • Distinguished name (DN)
  • Canonical DN
  • Domain\Username
  • Email address
  • GUID
  • LegacyExchangeDN
  • SamAccountName
  • User ID or user principal name (UPN)

Parameter properties

Type:MailboxIdParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-IncludeFolders

Applicable: Exchange Server 2010

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 English because calendar in other languages is a different word.

Parameter properties

Type:

MapiFolderPath[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Locale

Applicable: Exchange Server 2010

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.

Parameter properties

Type:CultureInfo
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MaxThreads

Applicable: Exchange Server 2010

The MaxThreads parameter specifies the maximum number of threads to use.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecipientKeywords

Applicable: Exchange Server 2010

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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecoveryDatabase

Applicable: Exchange Server 2010

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:

  • Name
  • Distinguished name (DN)
  • GUID

Parameter properties

Type:DatabaseIdParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecoveryMailbox

Applicable: Exchange Server 2010

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.

You identify the mailbox by its GUID value. You can find the GUID value by using the Get-Mailbox or Get-MailboxStatistics cmdlets.

Parameter properties

Type:StoreMailboxIdParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-SenderKeywords

Applicable: Exchange Server 2010

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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StartDate

Applicable: Exchange Server 2010

The StartDate parameter specifies the start date. The start date must be before the end date.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubjectKeywords

Applicable: Exchange Server 2010

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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetFolder

Applicable: Exchange Server 2010

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 specified with the Identity parameter isn't the same as the value specified with the RecoveryMailbox parameter.) In this case, the Restore-Mailbox command performs a merge. If the values are the same, the TargetFolder parameter isn't required.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ValidateOnly

Applicable: Exchange Server 2010

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Applicable: Exchange Server 2010

The WhatIf switch simulates the actions of the command. You can use this switch to view the changes that would occur without actually applying those changes. You don't need to specify a value with this switch.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Input types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn't accept input data.

Outputs

Output types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn't return data.