How to re-enable inactive mailbox from litigation hold in exchange online using Power Shell(Manual)
Posted On October 1, 2020
When users leave the company you might want to retain the email for a longer period than the default 30 days. By enabling litigation hold you can retain mailboxes longer than 30 days, before you disable a user you can set the litigation hold to any value you would like. But at some point you might need the mailbox to be re-enabled for some reason. In this manual I am going to explain how to do it.
STEP 1: Open a new Power Shell window and type the following command
Next type in the following command to connect to Exchange Online, and login using the screen that pops up:
STEP 4: The last step is to convert the inactive mailbox to a active mailbox with an active Office 365 user. So you will need to create a new mailbox identity where we will attach the inactive mailbox to. So make sure to fill in the following fields from the code below:
NOTE: If you have an on-premise environment with AD-Connect, you might need to use the .onmicrosoft.com address to reactivate the mailbox. The user/mailbox can be attached to a on-premise user afterwards.
Run the following command after changing the values, it might take up to a few minutes to complete.
New-Mailbox -InactiveMailbox $InactiveMailbox.DistinguishedName -Name "Cor den Boer" -FirstName Cor -LastName den Boer -DisplayName "Cor den Boer 2azure" -MicrosoftOnlineServicesID email@example.com -Password (ConvertTo-SecureString -String 'P@ssw0rd' -AsPlainText -Force) -ResetPasswordOnNextLogon $true
The result should look like this:
The user is now restored, and you should be able to logon with the credentials provided.