troubleshooting Question

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

Avatar of ajdratch
ajdratch asked on
ExchangeMicrosoft 365
3 Comments1 Solution170 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
ajdratch

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros