** Firstly I must apologise as I didn't manage to get any screenshots of the original error in the Exchange Management Shell, and I am not an Exchange expert either and this is just what I found and figured out (hope someone finds this useful) **

I was trying to decommission an Exchange 2010 Server as all the mailboxes had been migrated to Exchange Online, that when trying to uninstall Exchange I ran into a message saying that there were still some mailboxes mounted on the Exchange database which was weird as all the mailboxes had been migrated to Exchange Online and the EAC didn't show any mailboxes listed either 😕.

I then turned to Google, which pointed to arbitration mailboxes being present and I ran the PowerShell command to view the mailboxes:

Get-Mailbox -Database MYDB -Arbitration

There were two being listed, and I thought great I have found my answer and I can delete the arbitration mailboxes by running the following PowerShell:

Get-Mailbox -Database MYDB -Arbitration | Remove-Mailbox -Arbitration -RemoveLastArbitrationMailboxAllowed

Which came back with an unexpected error saying that it could not find the mailbox object on Domain Controller mydc01.contoso.com. After looking through ADUC, I could see the two accounts which was FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 and SystemMailbox{1f05a927-58bc-4190-9d39-f70a95ba002a}.

After a few hours of looking through forums and reading up on what these do 💡, I decided to delete the accounts out of AD (after double checking that the AD recycle bin was turned on!) in order to recreate them and then try to remove them afteward. Once I had completed that, I mounted the Exchange 2010 ISO onto the Server and opened up a command prompt and changed the directory to the ISO. I then ran:

setup.com /preparead

Running this command re-created the FederatedEmail and SystemMailbox user accounts in AD, but did not attach them back to the Exchange database. Running this command also had a pleasant side effect in that it removed the previous erroneous arbitration entries within the Exchange database for me. Running the Get-Mailbox -Database MYDB -Arbitration command did not return any entries 🥳.

I then attempted to uninstall Exchange 2010 again, and this time it went through without any issues.