Home ยป Exchange Server ยป Exchange 2013 Database Removal Error: "This mailbox database contains one or more mailboxes"

Exchange 2013 Database Removal Error: "This mailbox database contains one or more mailboxes"

When attempting to remove a database from an Exchange Server 2013 mailbox server you may encounter the following error.

Error attempting to remove an Exchange Server 2013 database

This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes.

This error can occur even on a brand new mailbox database that you have not migrated any mailboxes to or created new mailboxes on.

The error message contains details that describe both the root cause (mailboxes that still exist on the database) and the solution (removing the mailboxes). Let’s take a look at each of the mailbox types and the required actions to move or remove them.

Mailbox Users

Normal mailbox users can be moved to another database. To move the mailboxes issue a New-MoveRequest command and wait for the moves to complete.

For example, to move the mailboxes from “Mailbox Database 2” to “Mailbox Database 1” the following command is used.

Archive Mailboxes

The cmdlet provided in the error message does not actually help you identify archive mailboxes located on the database in question. For example if I am trying to remove “Mailbox Database 2”, the error message tells me:

To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database DatabaseID -Archive.

However, running that command shows me no results.

Instead I can run this command to identify mailboxes with the ArchiveDatabase attribute matching the database that I’m trying to remove.

To move those archive mailboxes I can issue the New-MoveRequest cmdlet again.

Arbitration Mailboxes

Arbitration mailboxes serve a variety of purposes in Exchange Server 2013, but the important thing at the moment is that they will prevent removal of the database on which they reside.

To view the arbitration mailboxes for a database append the -Arbitration switch to the Get-Mailbox command.

Arbitration mailboxes can be moved to another database like any other mailbox move request.

Public Folder Mailboxes

In Exchange Server 2013 public folder data is stored in special “public folder mailboxes” that can reside within the same databases as regular mailboxes. To check a database for public folder mailboxes run the following command.

Public folder mailboxes can be moved the same as other mailboxes.

Mailbox Plans

Mailbox plans are not relevant for on-premise installations of Exchange Server 2013 so you can disregard these.

Completing the Removal of an Exchange 2013 Database

When all of the above mailbox types have been removed from a database you can proceed with the removal of the database itself.

In the Exchange Admin Center navigate to Servers -> Databases, highlight the database you wish to remove and then click on the trash icon.

If you were successful in identifying and removing all of the mailboxes from the database then the database removal should complete successfully.

Paul is a Microsoft MVP for Office Servers and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul is a co-author of Office 365 for IT Pros and several other books, and is also a Pluralsight author.
Category: Exchange Server

41 comments

  1. Vivek Sharma says:

    I had faced this on Exchange 2010 as well while trying to delete the default mailbox databases created when you install the MBX role. Had to move all the obstructing mailboxes through EMS before it would allow a delete.

  2. kamal@sandarusi.com says:

    GAH!
    I need to read more and be less impulsive.
    So after 2010SP3 came out I though I was free and clear to install 2013 in my 2010 environment.

    NOOOO! 2013 doesn’t work right, (but it installed normally!) It worked for a little while. After further reading, I realized I was supposed to wait for 2013CU1. grrrrr.

    SO now I want to remove it, but I get the arbitration mailbox problem. Trouble is, they won’t move to the 2010 database, so I am stuck.

    Q: Would it be safe to disable the arbitration mailboxes in the 2013 installation, so I can remove it?
    or
    Q: should I just wait until CU1 comes out, and try to upgrade the 2013 to 2013cu1?

    Thanks.

  3. Joerg Richter says:

    Hi Paul,

    good job!!

    It just stopped unexpected for me, cause it seems not possible to delete the datafiles from your removed mailbox, I always get “file is open in another program”. And if you managed to identify and stop these other “programs” (exchange search host controller) you can delete those file, but after restart of stopped services they all come back by magic.

    Do you run into the same “feature”

    Thanks!

  4. Mike says:

    I followed this guide and moved all user and arbitration mailboxes I could find to another database and then deleted the database. Deleting the database was successfull, I suppose, as it disappeared from the EAC UI, but I got an error at the same time as it told me to manually delete the database file: “Failed to remove monitoring mailbox object of database “Default database”. Exception: Active Directory operation failed on dc.contoso.local. This error is not retriable. Additional information: Access is denied. Active directory

    response: 00000005: SecErr: DSID-031520B2, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0 .”

    If I run”Get-Mailbox -Monitoring” now it shows three warnings like the below:

    “WARNING: The object contoso.local/Microsoft Exchange System Objects/Monitoring Mailboxes/HealthMailboxb6d12aac1ab742e9a638474d740c70d7 has been corrupted, and it’s in an inconsistent state. The following validation errors happened:
    WARNING: Database is mandatory on UserMailbox.
    WARNING: Database is mandatory on UserMailbox.”

    Any clue to why that is occuring, and is it safe to just remove those three mailboxes by force?

  5. Gene says:

    Problem: I have PF on server 1, 3 and 4, PF’s are in use on 3 and 4 but I had replication from 3 going to 1 until the other day when the DB had an issue, I tried to remove it from the console in EX2010 but it said it couldn’t, I tired to removed it manually and the logs as well but it never would let me remove it in Exchange2010, now I’m stuck with a PF that doesn’t work on Sever 1 and it won’t let me remove it nor build a new until that one is gone, the DB is now corrupt and seems to be the same issue for the logs. Is there a way to force the old PF off of server one and try a new replication on a new PF? BTW the PF Database I’m trying to remove shows that it is dismounted in the console and also will not let me mount it either.

  6. vadim says:

    Another nice one is discovery mailbox. If you try to remove default db it wont let you because there is hidden (from Ick at least) Discovery mailbox. The only way I figured to deal with it is to use move all mailboxes option in pms.

  7. Bikram says:

    HI, My mailbox database is corrupt and wount mount…therefore cant move the arbitration mailboxes to new DB, it gives DB is not mounted.. as the DB is corrupt its not mounting… exchange 2010 SP3

    How to move or recreate the Arbitration mailboxes to new DB, I have already moved all my mailboxes.. but can remove the old datastore.. any pointers…
    thanks for the help…

  8. Neil says:

    Hi Paul,

    Sorry for posting here, however I could not find your exchange 2010 article to delete a mailbox database.

    I have a database in exchange 2010 which I am unable to delete. It has no user mailboxes and the arbitration mailboxes have been moved to a different DB, yet I am unable to remove the DB. I have checked for soft deleted and archive mailboxes and these do not exist in the DB either.

    Is there anything I am missing? I am hoping you can shed some light on this?

    Thanks in advance for your help

  9. Steve Rackham says:

    Hi Paul
    I too am in Neil’s position.
    All mailboxes have been moved and nothing is reported when querying the database, Exchange 2010 SP3 to 2013 CU5 upgrade and removing the last 2010 database I get this error.
    Any advice on how to progress greatly appreciated. I have tried setting ADServerSetting to true with no luck either.
    Thanks for your help.
    S.

  10. PJ says:

    You can only say thank you once again to Microsoft for wasting everyones time with their ridiculous products. How many posts and blogs for a simple thing like remove a database. And i remember having the same problem 10 years ago in 2003! You could now possibly suck any more microsoft exchange development team. You brought us windows so we didn’t have deal with command lines and now you brings command lines to deal with windows!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! kill me now!

  11. Jon Beets says:

    Paul,

    Great article. It covers all the mailbox moves required before a mailbox database delete. Thanks for taking the time to document the steps. Exchange 2013 is a complex product that requires preparation and training, imho.

    Jon

  12. Roman says:

    Hi, I moved all archive mailboxes to new database. Move was successful however, mailboxes were not deleted from old databases, therefore I’m not able to delete old database.

    Any advise?

  13. Garmac says:

    I have the same issue as Bikram. Can’t move the arbitration mailboxes. Even after fixing my mailbox database and it shows clean shutdown, it errors out when I try to mount it. How can I re-create the arbitration database to my new working mailbox? I’m at 2013 CU7 with 2010 coexistence environment. Thanks for any pointers

  14. Andrew says:

    had a client with a single server single db environment that the server failed on in the end due to duplicate SPN in the directory for the exchange server. Before we were able to determine that MS had me stand up a new server from scratch copy over the database rename it and mount it on teh new server with a new name. I now still have the records of the original server/database in my exchange environment. Aside from manually removing this using ADSI edit, is there a way I can manually remove the database references using the preferred tools (EAC, or EMS)? just curious because the old database doesn’t exist and cannot be mounted to move mailboxes the system thinks still exist in the database which prevents me from removing it using EAC.

  15. Luis says:

    As always, thank you for clear advice and instruction! I just wanted to add that if you’re trying to get rid of a mailbox database in an Exchange 2013/2016 DAG environment there may be some hidden mailboxes in addition to the arbitration mailboxes that need to be migrated off.

    This will move those HealthMailbox accounts:
    Get-Mailbox -Database “” -Monitoring | New-MoveRequest -TargetDatabase “”

    This will move a hidden SystemMailbox:
    Get-Mailbox -Database “” -AuditLog | New-MoveRequest -TargetDatabase “”

    Once user, public folder, archive, arbitration, monitoring, and auditlog mailboxes have been moved, the mailbox should delete without further whining.

    • Daniel says:

      Thank you so much!! I was pulling my hair out because I was unable to remove the initial Exchange 2016 database. Now I know why. ๐Ÿ™‚

    • ndfan77 says:

      > This will move a hidden SystemMailbox:
      > Get-Mailbox -Database โ€œโ€ -AuditLog | New-MoveRequest -TargetDatabase โ€œโ€
      ^^
      THIS!!

      I was also pulling my hair out for hours trying to get my first Exchange 2016 Server to uninstall after a like-for-like migration to a second Exchange 2016 Server. Nothing actually showed for:

      Get-Mailbox -Database DB01
      Get-Mailbox -Database DB01 -Arbitration
      Get-Mailbox -Database DB01 -Archive
      Get-Mailbox -Database DB01 -PublicMailbox

      And,

      Remove-MailboxDatabase DB01 -Verbose

      Showed no clues before the ever frustrating “This mailbox contains one or more Mailboxes, Mailbox Plans….” dialog.

      Finally,

      Get-Mailbox -Database DB01 -AditLog

      Showed a SystemMailbox… And, after doing:

      Get-Mailbox -Database DB01 -AuditLog | New-MoveRequest -TargetDatabase DB02

      I was finally able to proceed with the uninstall on the Exchange 2016 server that hosted DB01.

      However, the (expletive withheld) Exchange 2016 uninstall crashed after “Step 9 of 13: Stopping Services”. I hope the remaining steps had nothing to do with removing the server from Active Directory.

      As best I can tell it does seem to have been removed. Poking around EAC doesn’t show any sign of it in under Servers: Servers/Databases/Virtual Directories.

      If anyone knows what the remaining uninstall steps 10, 11, 12, and 13 are I’d appreciate knowing for sure whether I need to focus any further on the incomplete uninstall.

  16. David says:

    Nice, but the EAC shows no database exists. The files do not let me delete them. I am going to add copies from another server to form a DAG. Will the files hurt anything? Not sure what to do about them.

    • So in Windows explorer you see an EDB file and you can’t find a database in Exchange that maps to that file?

      Next thing I would do is use a process monitor tool to see which process actually has the files locked.

  17. Kelley Underwood says:

    While building new databases on new storage, I negligently deleted the volumes (DB and Log) for the first database. There are no copies available on any other server and the disk files are gone. However, the DB still show in the list and I cannot remove it. I get the same info as you write about in this post.

    Is there a way to force the removal of this database. How about recreating system mailboxes that may have been located there?

    Thank you for your great articles!

      • Stuart says:

        Hi Paul,

        I moved the arbitration, monitoring and standard mailboxes from the default database as I wanted to delete it.

        I then removed the database in the EMS. Then found I couldnt delete the folder containing the old database (Exchange 2016MailboxMailbox Database 0477187271). So I stopped the ‘Microsoft Exchange Search Host Controller’ service. This enabled me to delete the folder which contained edb , logs and other files.

        Now I find the folder re-created itself and some subfolders and files have appeared inside: (edb remains deleted)

        Mailbox Database 0477187271905A7EC2-13F5-4299-BF55-0277C68C6A0B12.1.Singleindexmeta

        Mailbox Database 0477187271905A7EC2-13F5-4299-BF55-0277C68C6A0B12.1.Singlejournal

        Mailbox Database 0477187271905A7EC2-13F5-4299-BF55-0277C68C6A0B12.1.Singlems

        This is all becuase I didnt know about the Audit mailbox (no error to warn me) and then forcably (and regrettably) removed the containing folder on the file system.

        I have repeated the exercise on anothe rserver, this time removing the Audit MBX and dont have any problems deleting the actual files. So it seems related to the Audit MBX not having been removed properly.

        I see no way to recover this other than to find the entries in the configuraton partition to remove the references to the Audit MBX using ADSIedit.

        Any advice please?

  18. Mauro says:

    Hi Paul,
    I’ve moved all mailboxes into a new database, but the default database “Mailbox Database 0835252682” is still not deletable…
    How can I do?
    Thanks a lot!

      • joel escutia says:

        Hi Paul,
        What if I’m running Exchange 2010 Hybrid Configuration and want to remove all the databases on-prem and still use the exchange server for management. What command do I use to remove the last database that house the arbitration mailboxes? Will removing the arbitration accounts affect office 365 Hybrid?

        Thanks

  19. Charles says:

    We have a corrupt edb no repairs have worked backups are also bad, I am able to extract to PST the mailboxes but need to remove the unmountable edb. It will not delete because it sees existing mailboxes that I can not move.

    Any suggestions on how to eliminate the existing edb so I can create a new one and import the psts? We have been down 2 days now and I have had no sleep!

  20. Andrew Suthanah says:

    @ Paul Cunningham. Maybe add that if Exchange server is in child domain you should include Set-ADServerSettings -ViewEntireForest $true

    This is because arbitration mailboxes are ‘owned’ by AD accounts in the root domain.

    Thanks for the great info though ๐Ÿ™‚

    Andy

  21. Tim Schoeller says:

    ArchiveDatabase value is case sensitive. -eq “MDB1” is different from -eq “mdb1” in Exchange 2016 anyhow.

    Hope this helps someone save the hour I just lost.

Leave a Reply

Your email address will not be published. Required fields are marked *