How to Mount/Dismount Mailbox Databases in Exchange 2019, 2016, 2013, via PowerShell?

There are two ways to mount a mailbox database for Exchange Server. We are going to explore PowerShell method as it’s faster than using the UI. To mount a database by using UI, you need to first login into Exchange Admin Center, then follow these steps:

  • Click on Servers
  • Then click on Databases
  • Highlight the database you wish to mount
  • Click on the three dots icon
  • Now click on the Mount button or Dismount button

However, a drawback of this method is that you can only mount or dismount one database at a time. You cannot mount multiple mailbox databases at once. This method is slower as compared to PowerShell. To mount/dismount database using PowerShell, you need to start off by opening Exchange Management Shell and use Mount-Database cmdlet.

First of all, you need to know the database name. This can be obtained either from the Exchange Admin Center or by using Get-MailboxDatabase cmdlet.

Before trying to mount the database, use PowerShell to determine the status of the database or databases in the Exchange Setup. You can use Get-MailboxDatabase and Format-Table to get the required information. To get the health status use the command described below:

Get-MailboxDatabase –Identity <database name> -Status | Format-Table Name, BackupInProgress, OnlineMaintenanceInProgress

To check all the databases, you need to change the –identity with the –servername and of course, the name of server.

Get-MailboxDatabase –Server <server name> -Status | Format-Table Name, BackupInProgress, OnlineMaintenanceInProgress

Alternatively, you can use ESEUTIL /mh command to determine the state of database.

eseutil /mh <full path to the edb file>

In the state, you will see either Clean Shutdown or Dirty Shutdown. Once you know the name of the database and checked that it is healthy, the mount can be done as follows.

Mount-Database –Identity <dbname> –Confirm:$False

If you would like to have a confirmation, enter Yes to continue, and remove the –Confirm part at the end of command.

This will mount the desired database. What if you would like to mount all the databases in your server? There are two ways to mount all databases in your Exchange Server. One is by using the ForEach loop using the Get-Database and then using the Mount-Database or you can use the one liner as below using the pipe. For faster and quicker one, here is the command.

Get-MailboxDatabase –Server | Mount-Database –Confirm:$False

This will execute Mount-Database command for each database in the server. In case you want to dismount single or multiple databases, you only need to change the first part of the cmdlet from Mount-Database to DisMount-Database. See the example below.

DisMount-Database –Identity <dbname> –Confirm:$False

If no issue arises, your database will be mounted or dismounted easily.

The above commands apply to Exchange Server 2010, 2013, 2016 and 2019. If you are still running 2010 and 2013, it is recommended to upgrade it to a newer version.

If the database doesn’t mount due to missing log files, corrupted log files or corrupted database, there isn’t any native application to export from a dismounted database. In such cases, applications like Stellar Repair for Exchange can help and restore your services as soon as possible, with minimum interruption to the user’s services.

Rating by Expert:

Reference: https://www.sysprobs.com/stellar-exchange-recovery-tool

With Stellar Repair for Exchange, you can open any version of Exchange Database (EDB) file – from 2007 till 2019. Exchange Recovery Software scans corrupted EDB file & recovers all mailbox items in case of missing log files. You can also export the EDB file to popular formats such as PST, EML, PDF and other. If your database is corrupted due to an operating system, application, third-party software or hardware failure, you can also create a new database in your Exchange setup and use the application to import it directly into a live Exchange Server. You can also use the application to import an EDB file directly into an Office 365 tenant, thus using it as a migration tool.