You like to test outbound mail flow in Exchange Server 2016 after installing and configuring…
Mount database Exchange with PowerShell
You want to mount a database in Exchange with PowerShell. Or you like to mount all the databases on a particular Exchange Server. In this article, you will learn how to mount a database in Exchange with PowerShell. Do you like to know how to dismount a database? Read the article dismount database in Exchange with Powershell.
Table of contents
Status mailbox database mounted
Let’s see the mounted status of the databases. Run Exchange Management Shell as administrator. Run the following command.
[PS] C:\>Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted
Name Server Mounted
---- ------ -------
DB01 EX01 False
DB02 EX01 False
DB03 EX01 False
DB04 EX01 False
DB05 EX01 False
We have five databases on the Exchange Server. The Mounted status is showing False on the databases. This means that the databases are not mounted.
Mount mailbox database Exchange
Mount single database. We are going to mount the database DB01 and check the mounted status. We will add the switch -Confirm:$False at the end of the command. This will not give us a warning if we are sure to mount the database on the Exchange Server.
[PS] C:\>Mount-Database "DB01" -Confirm:$False
[PS] C:\>Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted
Name Server Mounted
---- ------ -------
DB01 EX01 True
DB02 EX01 False
DB03 EX01 False
DB04 EX01 False
DB05 EX01 False
DB01 is showing the Mounted state as True. This means that the database DB01 is in a mounted state. Great!
Mount multiple mailbox databases Exchange
What if you have a lot of databases on an Exchange Server and you like to mount them? You don’t want to run the command one by one and changing the Identity of the database to another name. We are going to mount all the databases on the Exchange Server EX01. Add the switch -Confirm:$False on the end of the command. After that, we are going to check the database mounted status.
[PS] C:\>Get-MailboxDatabase -Server "EX01" | Mount-Database -Confirm:$False
[PS] C:\>Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted
Name Server Mounted
---- ------ -------
DB01 EX01 True
DB02 EX01 True
DB03 EX01 True
DB04 EX01 True
DB05 EX01 True
All the databases on Exchange Server EX01 are showing as True. This means that the databases are in a mounted state.
Read more: Get Exchange mailbox database mount status with PowerShell »
Conclusion
You learned how to mount a database in Exchange with PowerShell. You also learned how to mount all the databases on a particular Exchange Server. Make use of the -Confirm:$False switch. I hope that this article was informative to you.
Did you enjoy this article? You may like Dismount database Exchange with PowerShell. Don’t forget to follow us and share this article.
This Post Has 0 Comments