How to remove Exchange 2013 Mailbox Database using PowerShell
In this post i want to share something that’s very common but i thought i’ll share some steps on removing a mailbox database. This post will focus only on doing these steps using Powershell.
Firstly run the following command to get a list of all Exchange Mailbox Databases.
1 |
Get-MailboxDatabase |
Now that we have the list of Mailbox Databases , lets go ahead and select the Database you need to remove, but before you remove the database you need to first verify if there is any “Copy” Mailbox Databases associated with that database.
1 |
Get-MailboxDatabaseCopyStatus -Identity EXHDB03 |
To remove the “Copy” Mailbox Databases we need to run the following command on all Exchange Servers hosting the copy Mailbox Database.
1 |
Remove-MailboxDatabaseCopyStatus -Identity EXHDB03\EXMBX01 -Confirm:$false |
I have added the “Confirm:$false” option so that i wont be prompted to provided an input for the command to continue and remove the “Copy”.
Before you continue to remove the actual Database lets verify that all “Copies” has been removed by running the same command as before.
1 |
Get-MailboxDatabaseCopyStatus -Identity EXHDB03 |
After verifying the next step is to remove the Actual Mailbox Database, to complete this step run the following command.
1 |
Remove-MailboxDatabase -identity EXHDB03 -Confirm:$false |
After running the command you will be Prompted with a “Warning” to manually remove the “.edb” files from disk. If you received an additional “Warning” as in the above image then you can following the following article. The “Warning” indicates that the removal process could not remove the Active Directory user object associated with the “Monitoring Mailbox” for the Database which has been removed.
Ps. These commands was run against Mailbox Databases which was already Dismounted.
To Dismount a Mailbox Database run the following command.
1 |
Dismount-Database -Identity EXHDB03 -Confirm:$false |
In my next post i post How to remove an Exchange server from the Exchange organization and this will also be mostly in PowerShell 🙂 .
#ThatLazyAdmin
Be First to Comment