Symptom: After running disable-remotemailbox on shared mailboxes the mailboxes were still showing as active in Exchange Online.
Cause: Disable-remotemailbox only works if a account is a user mailbox AND the user mailbox is licensed. If you try any other combination of changing to a user mailbox and licensing order of operations, the mailbox will not be deleted.
Option 1 – Delete your user accounts or move them out of sync scope (for a minimum of 30 days). We couldn’t do this as there were several active user accounts that needed other 365 services.
Option 2 – Relicense and convert the account prior to deleting. Note you need to run an adsync and make sure it has flowed through to exchange online prior to taking the next step. Proxy Addresses are a good thing to look at here.
1. Run Enable-RemoteMailbox
2. Run a sync in Azure AD Connect server
3. License the user account
4. Run again sync in Azure AD Connect server
5. Remove the license of the user account
6. Run again a sync in Azure AD Connect server
7. Run Disable-RemoteMailbox