July 2017
Intermediate to advanced
648 pages
31h 9m
English
Let's say that you have restored your database from backup, you have created a recovery database, and now you need to restore each mailbox in the backup to the corresponding target mailboxes that are currently online. We can use the following script to accomplish this:
$mailboxes = Get-MailboxStatistics -Database RecoveryDB
foreach($mailbox in $mailboxes) {
New-MailboxRestoreRequest -SourceDatabase RecoveryDB `
-SourceStoreMailbox $mailbox.DisplayName `
-TargetMailbox $mailbox.DisplayName
}
Here you can see that first, we use the Get-MailboxStatistics cmdlet to retrieve all the mailboxes in the recovery database and store the results in the $mailboxes variable. We then loop through each mailbox and restore the data ...
Read now
Unlock full access