After Part 1 has already described how to create a backup with the Windows Server backup and Part 2 restoring a mailbox from the backup, it is now time for the other options in Part 3.
You do not always want to overwrite an existing mailbox with the mailbox from the backup; other options for restoring are described below. The basis is the Recovery database from part 2. I am therefore only listing the corresponding commands for recovery.
Restore to a subfolder of the mailbox
The following command restores the mailbox of the "Administrator" user to the "Administrator" mailbox in the "Restore" subfolder:
New-MailboxRestoreRequest -Name "Administrator" -SourceDatabase RecoveryDB -SourceStoreMailbox "Administrator" -TargetMailbox "Administrator" -TargetRootFolder "Restore"
The "Restore" folder is created automatically.
TipBefore restoring a complete mailbox to a subfolder of the existing mailbox, it is worth taking a look at the size of the mailbox and the configured limits.
Restore to an archive mailbox
It is also possible to restore to an archive mailbox. The following command can be used for this:
New-MailboxRestoreRequest -Name "Administrator" -SourceDatabase RecoveryDB -SourceStoreMailbox "Administrator" -TargetMailbox "Administrator" -TargetIsArchive
If the corresponding user does not have an archive mailbox, an error message is displayed. The archive mailbox is not created automatically:
An archive mailbox can be created with the following command so that the recovery works:
Enable-Mailbox administrator -Archive -ArchiveDatabase FWARCH1
Restore to another mailbox
It is also possible to restore a mailbox from the backup to another mailbox. In this example, the "Info" mailbox is restored from the backup to the "Administrator" mailbox in the "Restore" subfolder:
New-MailboxRestoreRequest -Name "Info" -SourceDatabase RecoveryDB -SourceStoreMailbox "Info" -TargetMailbox "Administrator" -TargetRootFolder "Recovery" -AllowLegacyDNMismatch
Tip: Here too, attention should be paid to the configured limits
Restoring individual folders
If it is known which folder is to be restored from the backup, this is also possible. The following command only restores the "Inbox" folder without subfolders:
New-MailboxRestoreRequest -Name "Administrator" -SourceDatabase RecoveryDB -SourceStoreMailbox "Administrator" -TargetMailbox "Administrator" -IncludeFolders "Inbox" -TargetRootFolder "Restore Inbox"
The following command can be used to restore a folder and its subfolders:
New-MailboxRestoreRequest -Name "Administrator" -SourceDatabase RecoveryDB -SourceStoreMailbox "Administrator" -TargetMailbox "Administrator" -IncludeFolders "Inbox/*" -TargetRootFolder "Restore Inbox"
Recovery of individual mails?
It is not possible to restore individual mails directly. There is no parameter for "New-MailboxRestoreRequest" that can filter for specific senders or a specific time period. Restoring individual mails for a user can also be a lengthy process, especially if the user no longer knows exactly what they are looking for...
As an alternative, I would suggest restoring the entire mailbox from the backup, preferably to a separate mailbox, and then giving the user access to the mailbox:
New-MailboxRestoreRequest -Name "Administrator" -SourceDatabase RecoveryDB -SourceStoreMailbox "Administrator" -TargetMailbox "TempRestoreMailbox" -AllowLegacyDNMismatch Add-MailboxPermission TempRestoreMailbox -User Administrator -AccessRights FullAccess
The mailbox from the backup is restored to the "TempRestoreMailbox" mailbox and made available to the user. The user can now search for the desired mail themselves and copy it to their mailbox. Once the user has found the mail, "TempRestoreMailbox" can be deleted again. In this way, the user's mailbox does not expand unnecessarily and the admin does not have to spend hours searching for a mail.
Display or delete MailboxRestoreRequests
Existing MailboxRestoreRequests can be displayed with the following commands:
Get-MailboxRestoreRequest Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics
All restore requests can be deleted with the following command:
Get-MailboxRestoreRequest | Remove-MailboxRestoreRequest
MailboxRestoreRequest hangs in the "Queued" status
In the event that MailboxRestoreRequests get stuck in the "Queued" status and the following error message is logged in the event log:
EventID 1006
Source: MSExchange Mailbox Replication
The Microsoft Exchange Mailbox Replication service was unable to process jobs in a mailbox database.
Database: RecoveryDB
Error: MapiExceptionRecoveryMDBMismatch: Unable to open message store. (hr=0x80004005, ec=1165)
Diagnostic context:
Lid: 55847 EMSMDBPOOL.EcPoolSessionDoRpc called [length=132]
Lid: 43559 EMSMDBPOOL.EcPoolSessionDoRpc returned [ec=0x0][length=248][latency=1]
So far, it has always helped me to restart the "Microsoft Exchange mailbox replication" service:
Deleting the recovery database
Once the relevant data has been restored, the restore database can be deleted again:
Dismount-Database RecoveryDB Remove-MailboxDatabase RecoveryDB
The database files can then be deleted; these are not deleted automatically and only take up unnecessary storage space after the data has been restored:
Vielen Dank für die Mühe, ein tolle Anleitung. Da es kein Single-Item Recovery gibt, bin ich mir sicher, dass dein Umweg mit dem Wiederherstellen in einem temporären Postfach vielen Menschen helfen wird.