Link to home
Create AccountLog in
Avatar of ajdratch

asked on

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

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
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

Is there more than one mailbox database?  

Or (maybe more likely) is this an old AD object that existed in a mailbox database prior to Exchange 2010?  The AD object may still exist, but the mailbox database it refers to no longer exists.  As it is, it's only passing back the GUID for the object.  It's entirely possible these items that won't remove themselves can't because they never existed in Exchange 2010.
Avatar of ajdratch


These are all the mailboxes that that were migrated to Office 365 so they did exist in Exchange 2010
Avatar of ajdratch

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account