Forum Discussion

BHSKenHen's avatar
BHSKenHen
Brass Contributor
Apr 03, 2019
Solved

Need to Restore Deleted Mailbox with a twist

Scenario: Exchange 2013 User Mailbox was Disabled via EAC AD User object was not disabled or deleted Mailbox shouldn't have been disabled, so they scrambled to fix the situation Instead of Re-c...
  • BHSKenHen's avatar
    BHSKenHen
    Apr 03, 2019

    Solved the issue; turns out, certain cmdlets, such as Get-MailboxDatabase | Get-MailboxStatistics can only be ran from an Exchange Server in the Shell. I perform nearly every Exchange mgmt task from my own machine via Remote Session. ($ExchSession = New-PSSession.... Import-PSSession $ExchSession...). When I run that command in Remote Session, I receive an error: The specified mailbox "DB15" doesn't exist. [Get-MailboxStatistics], ManagementObjectNotFoundException.

     

    I mostly followed the "https://docs.microsoft.com/en-us/exchange/connect-or-restore-a-deleted-mailbox-exchange-2013-help#use-the-shell-to-restore-a-deleted-mailbox" doc.

    1. From one of our Exchange Servers, I was successfully able to run this cmdlet:
      Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -eq "END USER" }
    2. This returned TWO entries, which is exactly what I expected to see
    3. I piped that into a Select DisplayName,MailboxGuid,Database,ServerName in order to obtain the original mailbox's source DB info:
      Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -eq "END USER" } | Select DisplayName,MailboxGuid,Database,ServerName
    4. This enabled me to successfully run a New-MailboxRestoreRequest:
      New-MailboxRestoreRequest -SourceStoreMailbox "GUID of deleted mailbox" -SourceDatabase MBXDB01 -TargetMailbox "END USER MB" -AllowLegacyDNMismatch
    5. Used this command to check the stats of the restore:
      Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics

Resources