Database commandlets

The Exchange Management Console in Exchange Server 2010 is not always the nicest tool to work with, especially if you've a large environment with multiple servers, a Database Availability Group and multiple copies of Databases.
The Console can be sluggish, the panes are not refreshed correctly and thus there's the risk of seeing "wrong" or not-updated information.
Instead of using the Exchange Management Console I often use the Exchange Management Shell to manage my Database Copies.
To get a list of all Mailbox Databases, use the following cmdlet:

Get-MailboxDatabase

To get a list of all Mailbox Databases on a particular server you can use a filter:

Get-MailboxDatabase | where {$_.ServerName -eq "<>"}

To get a list of all Mailbox Databases on a particular server in a DAG, including the replication health, you can combine the cmdlets:

Get-MailboxDatabase | where {$_.ServerName -eq "<>"} | Get-MailboxDatabaseCopyStatus

You can also select only a few options to show, this cmdlet will show the Mailbox Database Name and its Activation Preference in a DAG:

get-mailboxdatabase | select name,act*

Or to get a list of all active Mailbox Databases on a particular server:

Get-MailboxDatabaseCopyStatus | where {$_.ActiveDatabaseCopy -eq "<>"}

Move an active Mailbox Database from one server in the DAG to another node is much easier (and faster) using this cmdlet:

Move-ActiveMailboxDatabase -Identity db01 -ActivateOnServer e2010-mbx-c1n2 -MountDialOverride:none -Confirm:$false

And a list of all healthy Mailbox Database?

get-mailboxdatabase | Get-MailboxDatabaseCopyStatus | where {$_.Status -eq "healthy"}

This is my personal list of Mailbox Database cmdlets I use instead of using the Exchange Management Console

 

 

About The Author

Leave a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top