Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Exchange / How to Delete or Rename Default Mailbox Database in Exchange Server

March 17, 2024

How to Delete or Rename Default Mailbox Database in Exchange Server

When you install a new Exchange Server 2019/2016/2013/2010 with the mailbox role, the default mailbox database is automatically created. The database is created in the Exchange installation folder (C:\Program Files\Microsoft\Exchange Server\V15\Mailbox). The database name is also automatically generated (in my case it is “Mailbox Database 1200388344”). If you try to delete the default mailbox database, you will get the error This mailbox database contains one or more mailboxes. This is because this mailbox database contains a number of system mailboxes that are required for Exchange to work.

error on delete default database exchange

This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database <Database ID>. To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Arbitration. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID>. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -PublicFolder. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest <parameters>. If this is the last server in the organization, run the command Disable-Mailbox <Mailbox ID> -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan <MailboxPlan ID> -Database <Database ID>.

How to Rename and Move the Default Exchange Mailbox Database?

First, you need to get the database name, the path to the EDB file, and the logs. Run the Exchange Management Shell (EMS) or connect to your Exchange Server remotely using PowerShell. List the mailbox databases on the specific Exchnage server.

Get-MailboxDatabase -server mun-mbxm2.woshub.com| fl Name, EdbFilePath, LogFolderPath

To rename the database, use the Set-MailboxDatabase cmdlet (it is not necessary to unmount the DB):

Set-MailboxDatabase “Mailbox Database 1200388344” -Name MBX3-01

You can also rename the database from the Exchange Admin Center GUI.

By default, Exchange places the first mailbox database on the system drive (C:\). Be sure to move the database files to another disk. This will prevent the edb file and the Exchange mailbox database log files from taking up all free space on the Windows system drive.

The Move-DatabasePath PowerShell cmdlet is used to move the database. First, you need to unmount the database:

Dismount-Database -Identity DB3-01

Then move the database (.edb) and log files:

Move-DatabasePath DB3-01 -EdbFilePath F:\MailboxDB\DB3-01.edb -LogFolderPath F:\MailboxDB\DB3-01

After the migration is complete, you can mount the mailbox database:

Mount-Database -Identity DB3-01

Removing the Default Mailbox Database in Exchange Server

To remove a default mailbox database, you need to move all user and service mailboxes to a different DB. By default, the Get-Mailbox cmdlet doesn’t list system and service mailboxes in the database. To search for arbitration mailboxes, run the command:

Get-Mailbox -Arbitration -Database "Mailbox Database 1200388344"
Get System Mailbox Exchange 2010 / 2013

If the mailbox list is empty, it is possible that your Exchange is deployed in a child AD domain. To search the entire Active Directory forest, the following options must be enabled:

Set-ADServerSettings -ViewEntireForest $true

Now let’s move these mailboxes to another database:
Get-Mailbox -Arbitration -Database "Mailbox Database 1200388344" | New-MoveRequest -TargetDatabase db3-02
transfer system mailbox exchange2010 to another database

In addition to arbitration mailboxes, the default mailbox database can also have user mailboxes, an administrator mailbox, and a Discovery Search mailbox (used to search for email in Exchange mailboxes). They should also be moved:
Get-Mailbox -Database "Mailbox Database 1200388344" | New-MoveRequest -TargetDatabase db3-02
move admin and discovery search mailbox's

There may also be other types of mailboxes in your mailbox database: Monitoring, Auditing (used to store auditing events about users’ actions in mailboxes), Archive, and Public Folder mailboxes. Consistently check that your database doesn’t contain these mailboxes:

$mbxdb="Mailbox Database 1200388344"
Get-Mailbox -Database $mbxdb -Auditlog
Get-MailBox -Database $mbxdb -Archive
Get-MailBox -Database $mbxdb -PublicFolder
Get-MailBox -Database $mbxdb -GroupMailbox
Get-MailBox -Database $mbxdb -Monitoring

If such mailboxes are found, they must be moved using the following pipe: | New-MoveRequest -TargetDatabase DB3-02 (you can disable the Monitoring mailbox | Disable-Mailbox -Confirm:$false).

Check that there are no user mailboxes left in the database:

Get-Mailbox -Database "Mailbox Database 1200388344"

The mailbox database can store disconnected mailboxes. You can list the disconnected user mailboxes in the database as follows:

Get-MailboxStatistics -Database "Mailbox Database 1200388344" | Where { $_.DisconnectReason -eq "Disabled" } | ft DisplayName,Database,DisconnectDate,MailboxGUID

You won’t be able to restore these mailboxes after deleting the database.

Check that the migration process was completed successfully (StatusDetail=Completed):

Get-MoveRequest | Get-MoveRequestStatistics

get exchange mailbox moverequest statistics

After the migration is complete, be sure to clear all move request tasks:

Get-MoveRequest | Remove-MoveRequest

After moving the mailboxes, you can delete the default mailbox database
Remove-MailboxDatabase "Mailbox Database 1200388344"
delete exchange 2010 default database

Then you can manually remove the mailbox database files from the disk:

Remove-Item -LiteralPath "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 1200388344" -Force -Recurse

2 comments
5
Facebook Twitter Google + Pinterest
ExchangePowerShell
previous post
Can’t Remove Language Keyboard Layout in Windows 10
next post
Install Active Directory Users and Computers (ADUC) Snap-in on Windows 10/11

Related Reading

Outlook Keeps Asking for Password on Windows

March 17, 2024

How to Block Sender Domain or Email Address...

March 17, 2024

Get a List of Mailboxes a User Has...

March 15, 2024

How to Manually Configure Exchange or Microsoft 365...

March 17, 2024

Fix: Microsoft Outlook Search Not Working on Windows...

March 17, 2024

Search and Delete Emails from User Mailboxes on...

March 15, 2024

How to Enable Maintenance Mode on Exchange Server

March 12, 2024

How to Hide Users and Groups from the...

March 15, 2024

2 comments

Juan June 15, 2016 - 1:22 pm

Thanks, work for me!

Reply
Christian November 8, 2016 - 12:28 pm

Thanks, worked for me too!
One thing I have to mention: The database has to be mounted (through ECP or Shell).

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025
  • Disable the Lock Screen Widgets in Windows 11

    May 26, 2025
  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Outlook Keeps Asking for Password on Windows
  • How to Manually Configure Exchange or Microsoft 365 Account in Outlook 365/2019/2016
  • How to Cleanup, Truncate or Move Log Files in Exchange Server 2013/2016/2019?
  • Search and Delete Emails from User Mailboxes on Exchange Server (Microsoft 365) with PowerShell
  • Fix: Microsoft Outlook Search Not Working on Windows 10/11
  • Export Exchange or Office 365 Global Address List (GAL) to CSV
  • Send Emails with Microsoft Graph API and PowerShell
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top