Deleted mailboxes fail to appear in a soft-deleted state
We operate an Exchange hybrid environment using Azure AD Connect and ADFS with mailboxes on Exchange Online. We recently had a situation where we wanted to delete an old user account and its Exchange Online mailbox, and then move the contents of the old user’s mailbox to a new user. This scenario is discussed in the article “A better way to recover a mailbox” (https://blogs.technet.microsoft.com/exchange/2015/01/13/a-better-way-to-recover-a-mailbox/).
To delete the old account, we executed Remove-Mailbox in an Exchange Online PowerShell session and separately deleted the on-premises AD account. We found that the mailbox was not put into a soft-deleted state as we had expected. In support case SRX616061792521559ID, we determined that the mailbox could be recovered only by undeleting the user account from the on-premises AD recycle bin and re-licensing it on Office 365.
Based on other testing, we found that executing Remove-RemoteMailbox in an on-premises Exchange PowerShell session deletes the mailbox and associated on-premises Active Directory account, and does put the mailbox into a proper soft-deleted state.
I have a couple of suggestions related to this. First, better documentation. In the article “Delete or restore user mailboxes in Exchange Online” (https://technet.microsoft.com/en-us/library/dn186233(v=exchg.150).aspx), document this problem and state the requirement to use Remove-RemoteMailbox.
Second, prevent this from happening. When Remove-Mailbox is executed in an Exchange Online PowerShell session in a hybrid environment, fix things so that the mailbox is put into a proper soft-deleted state. Otherwisee throw an exception and prevent the mailbox from being deleted in this way.