How to Recover deleted mailbox in Exchange online
Procedure to copy the data from Deleted Mailbox to Active Mailbox.
1) Start Windows PowerShell
Start > search for “PowerShell” > Start Windows PowerShell by clicking on “Run as Administrator”.
2) Connect the Windows PowerShell to Office 365 Exchange Online . Please execute below command in PowerShell.
$LiveCred = Get-Credential (Supply Exchange Online Admin’s log in credentials in the prompt window)
Set-ExecutionPolicy Unrestricted (Proceed with Y if prompted)
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
3) Verify if the old mailbox is in deleted state.
Get-Mailbox -SoftDeletedMailbox accounts
4) If the Mailbox is found collect the ExchangeGuid of the deleted Mailbox.
(Get-Mailbox -SoftDeletedMailbox Deleted_User_Alias@domain.com).ExchangeGuid
5) Collect the ExchangeGuid of the Active Mailbox.
(Get-Mailbox ACTIVE_USER_ALIAS@domain.com).ExchangeGuid
6) Now copy the data from the deleted mailbox to the new Mailbox.
New-MailboxRestoreRequest -SourceMailbox “Guid of Deleted Mailbox copied from step 4” -TargetMailbox “Guid of Deleted Mailbox copied from step 5” –AllowLegacyDNMismatch -verbose
7) Monitor the same.
Get-MailboxRestoreRequest
8) Once it is completed all the data would be moved to the new one.
—–Sample with Regular PowerShell —–
1) Verify the active Mailbox.
Get-Mailbox ACTIVE_USER_ALIAS | FL Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database
2) Verified the same in the soft deleted list.
Get-Mailbox -SoftDeletedMailbox Deleted_User_Alias | FL Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database
3) Collect the data about the mailboxes.
1) Active Mailbox.
Get-Mailbox ACTIVE_USER_ALIAS | FL Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database
Name : ACTIVE_USER_ALIAS
Alias : ACTIVE_USER_ALIAS
UserPrincipalName : ACTIVE_USER_ALIAS@domain.com
ExchangeGuid : b09181cd-9183-4036-8946-9339dfa27702
Guid : 28101858-670e-4b47-aedc-7f9cc583a80dEmailAddresses : {SIP:ACTIVE_USER_ALIAS@domain.com, SMTP:ACTIVE_USER_ALIAS@domain.com, smtp:ACTIVE_USER_ALIAS@domain.com}
2) Deleted Mailbox.
Get-Mailbox -SoftDeletedMailbox Deleted_User_Alias | FL
Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database
Name : Deleted_User_Alias
Alias : Deleted_User_Alias
UserPrincipalName : Deleted_User_Alias@domain.com
ExchangeGuid : b4dc2e0c-d2ba-4524-9722-dd279b6c6f61
Guid : a3d02e59-60fd-4bca-b9ca-609c2f792891
EmailAddresses : {SIP:ecbb89072dda4219a644fab1b054efa6;Deleted_User_Alias@domain.com}
4) Creating the Mailbox restore request.
New-MailboxRestoreRequest -SourceMailbox b4dc2e0c-d2ba-4524-9722-dd279b6c6f61 -TargetMailbox b09181cd-9183-4036-8946-9339dfa27702 -AllowLegacyDNMismatch -Verbose
5) Once Request created successfully confirmed the batch completed successfully.
Get-MailboxRestoreRequest | FL Identity,requestguid,Status
See Overview of recover Soft deleted mailbox in Exchange online.