Share via


Exchange 2016 Troubleshooting: Mailbox isn't unique on database

Deleting mailboxes or recovering deleted mailboxes are something that Exchange Admins do often. For a refresher, the disconnected mailboxes will show up 24 hours after they have been removed and you can run a script to identify the disabled ones as below (script from docs.microsoft.com)

See: https://docs.microsoft.com/en-us/answers/questions/534545/exchange-2016-soft-deleted-public-folder-mailboxes.html

$dbs = Get-MailboxDatabase
$dbs | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisconnectReason -eq "Disabled"} | Format-Table DisplayName,Database,DisconnectDate

When you try and connect a mailbox to an AD user, it is supposed to complete right? What happens when you have two mailboxes on the same database that you want to restore? You get the error below:

https://everything-powershell.com/wp-content/uploads/2021/07/image-2-1024x173.png

The solution to the above is to find the GUID for the mailboxes and restore them that way, here is a command you can use to find the GUIDs:

Get-MailboxStatistics -Database DB01 | fl DisplayName,MailboxGuid

Get-MailboxStatistics -Database DB01 | fl DisplayName,MailboxGuid

You can now proceed with connecting to the database using the command below based on the GUID you got in the previous command:

Connect-Mailbox –Identity <guid> –Database DB01 –user RestoreUser1<br><ul><li></li></ul>

After this it should connect the account and you can login to the mailbox.