Applies to: Exchange Server 2010 SP3, Exchange Server 2010

Topic Last Modified: 2012-11-16

Use the Restore-Mailbox cmdlet to extract mailbox content from a restored database.

Note:
If you are running Exchange Server Service Pack 1 (SP1) or a later version, use the New-MailboxRestoreRequest cmdlet instead of the Restore-Mailbox cmdlet to extract mailbox content from a restored database. For more information, see New Mailbox and Recipient Functionality in Exchange 2010 SP1 and New-MailboxRestoreRequest.

Syntax

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

Detailed 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 all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Mailbox recovery" entry in the Mailbox Permissions topic.

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

The Identity parameter specifies the identity of the mailbox.

This parameter accepts the following values:

  • Alias

    Example: JPhillips

  • Canonical DN

    Example: Atlanta.Corp.Contoso.Com/Users/JPhillips

  • Display Name

    Example: Jeff Phillips

  • Distinguished Name (DN)

    Example: CN=JPhillips,CN=Users,DC=Atlanta,DC=Corp,DC=contoso,DC=com

  • Domain\Account

    Example: Atlanta\JPhillips

  • GUID

    Example: fb456636-fe7d-4d58-9d15-5af57d0354c2

  • Immutable ID

    Example: fb456636-fe7d-4d58-9d15-5af57d0354c2@contoso.com

  • Legacy Exchange DN

    Example: /o=Contoso/ou=AdministrativeGroup/cn=Recipients/cn=JPhillips

  • SMTP Address

    Example: Jeff.Phillips@contoso.com

  • User Principal Name

    Example: JPhillips@contoso.com

RecoveryDatabase

Required

Microsoft.Exchange.Configuration.Tasks.DatabaseIdParameter

The RecoveryDatabase parameter specifies the recovery database from which you're restoring the mailbox. You can use the following values:

  • GUID of the database

  • Database name

RecoveryMailbox

Required

Microsoft.Exchange.Configuration.Tasks.StoreMailboxIdParameter

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

Required

System.String

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.

AllowDuplicates

Optional

System.Management.Automation.SwitchParameter

The AllowDuplicates parameter specifies whether to copy mail items without checking if they're duplicates of existing items and without removing duplicate items. We recommend that you use the AllowDuplicates parameter together with the IncludeFolders parameter.

AllContentKeywords

Optional

System.String[]

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.

AttachmentFilenames

Optional

System.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

Optional

System.Int32

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

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch.

ContentKeywords

Optional

System.String[]

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

EndDate

Optional

System.DateTime

The EndDate parameter specifies the end date for filtering content that will 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.

ExcludeFolders

Optional

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

GlobalCatalog

Optional

Microsoft.Exchange.Data.Fqdn

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

IncludeFolders

Optional

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

Locale

Optional

System.Globalization.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

Optional

System.Int32

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

RecipientKeywords

Optional

System.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

Optional

System.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

Optional

System.DateTime

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

SubjectKeywords

Optional

System.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

Optional

System.Management.Automation.SwitchParameter

The ValidateOnly switch tells the cmdlet to evaluate the conditions and requirements necessary to perform the operation and then reports whether the operation will succeed or fail. No changes are made when the ValidateOnly switch is used.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch.

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.

Return 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.

Examples

EXAMPLE 1

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

Copy Code
Restore-Mailbox -Identity Scott -RecoveryDatabase MyRecoveryDatabase

EXAMPLE 2

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

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

EXAMPLE 3

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.

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

EXAMPLE 4

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

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