We help IT Professionals succeed at work.
Get Started

Exchange 2010 remove disconnected mailbox error - doesn't exist on database "mailbox"

ajdratch asked
Last Modified: 2020-01-19
I moved a client from Exchange 2010 to Office 365. Now that the migration is done, I want to remove Exchange.  All the mailboxes are disconnected however I can't remove them. I ran the commands:
$mailboxes = Get-ExchangeServer | Where-Object {$_.IsMailboxServer –eq $true} | ForEach-Object { Get-MailboxStatistics –Server $_.Name | Where-Object {$_.DisconnectDate –notlike ‘’}} | select displayname, mailboxguid, database

$mailboxes | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

I then get this message for every disconnected mailbox

Mailbox "31ea850d-6a5d-4286-9441-d5baf6c7c4ef" doesn't exist on database "Mailbox".
    + CategoryInfo          : NotSpecified: (0:Int32) [Remove-Mailbox], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : DFBA03DE,Microsoft.Exchange.Management.RecipientTasks.RemoveMailbox

I stopped the sync this morning by running Set-MsolDirSyncEnabled -EnableDirSync $false.

How can I remove these disconnected mailboxes
Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE