Recover an Inactive Mailbox in Office 365 (Exchange Online)

In order to recover an inactive mailbox in Office 365 (Exchange Online), you must search for the mailbox, get the Exchange GUID and then recover it to a new mailbox.

I will cover the basic process below, if you need more details, reference the Microsoft KB below.


Connect to Exchange Online with PowerShell

List inactive mailboxes with Exchange GUID

  1. Get-Mailbox -InactiveMailboxOnly | Format-List Name,DistinguishedName,ExchangeGuid,PrimarySmtpAddress

Create InactiveMailbox variable

  1. $InactiveMailbox = Get-Mailbox -InactiveMailboxOnly -Identity <identity of inactive mailbox>
  2. Use the ExchangeGUID from the previous step as the indentity

Recover inactive mailbox to a new mailbox

  1. New-Mailbox -InactiveMailbox $InactiveMailbox.DistinguishedName -Name johndoe -FirstName John -LastName Doe -DisplayName “John Doe” -MicrosoftOnlineServicesID -Password (ConvertTo-SecureString -String ‘P@ssw0rd’ -AsPlainText -Force) -ResetPasswordOnNextLogon $true
  2. The command above will create a new user and mailbox for John Doe and recover the inactive mailbox set in the variable above
  3. The MicrosoftOnlineServicesID must match the PrimarySMTPAddress returned from the first step

Configure the new user

  1. Make sure you assign a license to the newly created user
  2. If you are using AD Connect, make sure that the user on-premise shares the same anchor value as the synchronized user for soft matching to work correctly

Leave a Reply