Table of Content
    Exchange Server Recovery

    How to Use Get-MailboxDatabaseCopyStatus Command?


    Table of Content

      Summary: In this post, we’ve explained the parameters that are used in Get-MailboxDatabaseCopyStatus command. We’ve also explained the process to use the Get-MailboxDatabaseCopyStatus command. Also, you’ll find about an Exchange recovery tool that can help you recover Exchange database if anything goes wrong.

      Exchange Servers is a business-critical application that requires regular checkups and maintenance to ensure it works smoothly. One may deploy Exchange Server as a standalone or in a Database Availability Group that provides site resilience and automatic failover protection from a database failure.

      Get-MailboxDatabaseCopyStatus is one of the several PowerShell commands you can use to keep an eye on the replication health status of databases across all member servers in a Database Availability Group.

      You can use the cmdlet to ensure that both active and passive database copies are synchronized. This helps prevent data loss and downtime when disaster strikes or something happens to the main site or server. The PowerShell cmdlet works in Exchange Server 2010, 2013, 2016, and 2019.

      Get-MailboxDatabaseCopyStatus Syntax

      Below is the syntax of the Get-MailboxDatabaseCopyStatus.

      Get-MailboxDatabaseCopyStatus
         -Server <MailboxServerIdParameter>
         [-Active]
         [-DomainController <Fqdn>]
         [-ExtendedErrorInfo]
         [-UseServerCache]
         [<CommonParameters>]

      You can use the command to collect information on a specific database in your infrastructure or to get server-wide information.

      Let’s explore the parameters of this command.

      -Server or -Identity

      This parameter will allow you to specify the server’s name from which to retrieve the information. If you want to specify a specific database in a specific server, you need to replace the -server parameter with the -Identity and specify the database/server.

      -Active

      This parameter will return the information concerning the copy status of the active database.

      -DomainController

      In this parameter, you need to specify the domain controller you will be using to read or write the data from the Active Directory. You need to specify the fully qualified domain controller (FQDN) of the server, for example, activedirectory01.mydomain.lan.

      -UseServerCache

      This parameter specifies whether to enable the server-side remote procedure call (RPC) caching status for 5 seconds.

      How to Use “Get-MailboxDatabaseCopyStatus” Command?

      You need to have the right permissions to run the Get-MailboxDatabaseCopyStatus cmdlet. If you do not know what permissions or role assignments are required, you can run the following command.

      Get-ManagementRole -Cmdlet Get-MailboxDatabaseCopyStatus

      Get ManagementRole

      This command will provide the roles that you need to run the command.

      If you need full permissions depending on the parameters, you need to specify the parameters (as given below) and separate each parameter with a comma.

      Get-ManagementRole -Cmdlet Get-MailboxDatabaseCopyStatus -CmdLetParamaters extendederrorinfo, useServerCache

      Get-MailboxDatabaseCopyStatus

      After you get the right information, you need to get the permission active for the user to run the cmdlet. For this, open the Exchange Admin Center (EAC), click on Permission, and then click on Admin roles.

      It is suggested that you create a new role called GetMailboxCopyStatus and set the permissions needed and assign the users.

      EAC-Admin-roles

      Once this is ready, you will be able to run the command.

      While running the command, you may encounter many errors. The common ones are:

      • Failed
      • Crawling
      • Status Unknown
      • Failed and Suspended
      • Content Index failed

      One of the things you can do to troubleshoot, before running anything, is to check:

      • Any services are down
      • There is ample space
      • There are no connectivity issues
      • There are no connectivity issues with the Active Directory

      The next thing to do is run the following commands, depending on the infrastructure.

      In a Database Availability Group (DAG), run the following command on the affected indexes to get the failed status.

      Get-MailboxDatabase Database Name | Get-MailboxDatabaseCopyStatus | Select Name,*index*

      Database Availability Group

      Run the repair command to see if the issue would be fixed.

      Update-MailboxDatabasecopy <database>\<server> –sourceserver <server> –catalogonly

      MailboxDatabasecopy

      Depending on the size of the database and the server’s performance, this procedure can take some time.

      In the case of a standalone server, you need to follow the below procedure.

      Open command prompt or PowerShell and run the following commands:

      Stop-Service MSExchangeFastSearch
      Stop-Service HostControllerService

      Stop Service

      Now, browse to the database location and look for the folder having the name with the long GUID name and delete the folder. This will delete the content index of the database. Once this is done, you need to start the services again.

      Start-Service MSExchangeFastSearch
      Start-Service HostControllerService

      Start Service

      After a few minutes, the folder will be recreated and the content index will be rebuilt.

      free download

      Conclusion

      This is only one example, as each status will need the required procedure to be performed to try to mitigate the issue. If all fails and the active database cannot recover from the issue, the replication between the passive and the active copy (or vice versa) will not happen. If there is a server failure or a failover, you may have to face data loss.

      To quickly recover from such situations, you can rely on a certified application that will get you out of a sticky situation and recover your mailbox database with no data loss. Stellar Repair for Exchange is one such application that can open any Exchange Server database file in a healthy, corrupted, or dirty shutdown state. You can browse it and export the data to PST and other file formats. The application also exports the EDB data directly to a live Exchange Server database.

      Was this article helpful?

      No NO

      About The Author

      Ravi Singh linkdin

      Ravi Singh is a Senior Writer at Stellar®. He is an expert Tech Explainer, IoT enthusiast, and a passionate nerd with over 7 years of experience in technical writing. He writes about Microsoft Exchange, Microsoft 365, Email Migration, Linux, Windows, Mac, DIY Tech, and Smart Home. Ravi spends most of his weekends working with IoT (DIY Smart Home) devices and playing Overwatch. He is also a solo traveler who loves hiking and exploring new trails.

      Leave a comment

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

      Image Captcha
      Refresh Image Captcha

      Enter Captcha Here :

      Related Posts

      WHY STELLAR® IS GLOBAL LEADER

      Why Choose Stellar?

      • 0M+

        Customers

      • 0+

        Years of Excellence

      • 0+

        R&D Engineers

      • 0+

        Countries

      • 0+

        PARTNERS

      • 0+

        Awards Received