Due to a Retention Policy set for M365, all D93 Email & OneDrive accounts are backed up indeffinately. Accounts that are suspended from Active Directory will have an O365 license revoked, and after 30 days of no license, the Outlook mailbox associated with the AD account will be purged (all emails and the Mailbox will be deleted). The Retention Policy in place will create an inactive mailbox of that O365 account before it is purged. Inactive mailboxes are a snapshot of what was inside the mailbox before the Exchange license was revoked (it is not a backup of a mailbox, containing all emails ever recieved).
Inactive mailboxes can be viewed here:
https://compliance.microsoft.com/informationgovernance/retention/inactivemailbox
The following are steps that can be taken to restore an inactive mailbox to a current O365 mailbox.
If haven't done so already, import the ExchangeOnlineManagement module into Powershell, and Connect to Exchange Online:
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline
Next we will have to get the inactive mailbox identity and store it into a variable to use in a second command:
$inactiveMailbox = Get-Mailbox -InactiveMailboxOnly -Identity <USER EMAIL ADDRESS>
Next we will find the GUID of the active mailbox, we will need to use this GUID as the target mailbox to transfer the files from the inactive mailbox to the new mailbox. (This is used instead of transfering to the users email, becuase an error can occur where their email name will match multiple entries. If we specify the mailbox by GUID we are specifying exactly where this inactive mailbox will be merged with).
Get-Mailbox -Identity <USER EMAIL ADDRESS> | fl Name, Alias, DistinguishedName, GUID
In the output we can grab the GUID and put it in our next command:
New-MailboxRestoreRequest -SourceMailbox $inactiveMailbox.DistinguishedName -TargetMailbox <GUID> -AllowLegacyDNMismatch
We will use the -AllowLegacyDNMismatch hook to bypass errors that would occur because the system sees that the two mailbox accounts do not have matching legacyExchangeDN records.
We should see output like this:
Further information on this topc can be found here:
https://learn.microsoft.com/en-us/purview/restore-an-inactive-mailbox#restore-inactive-mailboxes
https://learn.microsoft.com/en-us/powershell/module/exchange/get-mailbox?view=exchange-ps
https://learn.microsoft.com/en-us/purview/create-retention-policies?tabs=teams-retention
Comments
0 comments
Please sign in to leave a comment.