Using PowerShell to restore recoverable items is quick way to deal with accidental deletions. Recently I came across an incident where a large number of items had been removed from the in-place archive of a mailbox. I was unable to find a documented restore method for this scenario and here we are.
The cmdlet Restore-RecoverableItems quicly restores items in the primary mailbox but it doesn’t have an “-Archive” flag and piping the command from something like: Get-Mailbox <PrimarySMTP> -Archive, doesn’t work either. The mailbox targeted will still be the users primary mailbox.
The solution to the problem is quite straight forward, just use the “ArchiveGuid” associated with the mailbox to perform the restore.
$ArchiveMailboxGUID = (Get-Mailbox <PrimarySMTPAddress>).ArchiveGuid.Guid
Restore-RecoverableItems -Identity $ArchiveMailboxGUID -ResultSize Unlimited