LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » Guest Post / Internet / Internet Information » How To Use Add-MailboxDatabaseCopy Command In Exchange Server?

How To Use Add-MailboxDatabaseCopy Command In Exchange Server?

How-To-Use-Add-MailboxDatabaseCopy-Command-In-Exchange-Server
In a Database Availability Group (DAG) setup in Exchange Server, you need to have an active copy of the database on a server and a passive copy on another server or servers. This copy will be seeded from the active database and will be in constant sync with the active database, until the automatic/manual failover. When this happens, the passive copy becomes the active database.

To add or create a passive copy of the active database, Exchange Server PowerShell has a command – Add-MailboxDatabaseCopy. Below, we will see how to use this command to create passive copies of the database.

Before Running Add-MailboxDatabaseCopy Command:

Before running this command, you need to ensure that the required roles/permissions are assigned to the user (you’re using to run the command). You can use the following command in the Exchange Management Shell (EMS) to get the roles needed to run the Add-MailboxDatabaseCopy command.

Get-ManagementRole -Cmdlet Add-MailboxDatabaseCopy

To know the permissions you need for the role, you can run the following command.

$Permissions = Get-ManagementRole -Cmdlet Set-MailboxServer
$Permissions | foreach {Get-ManagementRoleAssignment -Role $_.Name -Delegating $false | Format-Table -Auto Role,RoleAssigneeType,RoleAssigneeName}

Once the permissions have been assigned to the user to create the copy, you can go ahead to use the command. However, before proceeding, there are some things that you need know.

  • The destination server must be in the same Database Availability Group (DAG).
  • You can have more than one group in your setup but the group must be healthy and have a quorum.
  • You cannot create two copies of the same database on the same servers. There can only be one copy of the database on one server. You can have multiple copies of the same database on multiple servers.
  • The patch for the passive copy must be the same as the active database with the log and database paths.
  • Since synchronization relies heavily on the transaction logs, it’s important that circular logging is not enabled on the database being added to the Database Availability Group (DAG). To verify this, you can run the following PowerShell command:
Get-MailboxDatabase <database name> | Format-Table Name, CircularLoggingEnabled

Use-Add-MailboxDatabaseCopy-Command-In-Exchange-Server

Using the Command:

The command must be executed from the source server. Below is the example of the command.

Add-MailboxDatabaseCopy -Identity <source db> -MailboxServer <destination server> -ReplayLagTime 00:10:00 -TruncationLagTime 00:15:00 -ActivationPreference 2

The above command will create a passive copy of DB1 on the server SRV02. The parameters mentioned are ReplayLagTime, TruncationLagTime, and ActivationPreference.

Recommended For You:
Top Known Pros And Cons Of Freelancing You Must Know

ReplayLagTime is the amount of time that the Microsoft Exchange Replication service will wait before replaying the log files that have been copied to the database. The default value is 0, which means that once the transaction logs are transferred, these are committed. The maximum value is 14 days and it’s set as dd.hh:mm:ss (dd = days, hh = hours, mm = minutes, and ss = seconds). This is usually used for a third copy, which would replay the logs after a set number of days so that if something happens, then you have time to retrieve them.

TruncationLogTime is the amount of time that the Microsoft Exchange Replication service will have to wait until the truncation of the log file is started on the passive copy. Same as the ReplayLagTime, this has the default value of 0 and the maximum value is 14 days.

In case your server is geographically located and the bandwidth is not enough to seed the entire database over the internet or site-to-site VPN, you can use the SeedingPostponed command (see the below example). It will not seed the database and you can manually take a copy of the database on site.

Add-MailboxDatabaseCopy -Identity <source db> -MailboxServer <destination server> -ReplayLagTime 00:10:00 -TruncationLagTime 00:15:00 -ActivationPreference 2 -SeedingPostponed

To Conclude:

You create passive copies of the database for the resilience and protection of your data. You also use this so that you can failover to another server while doing maintenance work, such as Windows/Exchange Server Updates and hardware changes, fixes, or upgrades. However, you need to monitor and maintain the setup. If the replication fails and there is a failover, then there is a high risk of data loss.

Recommended For You:
Top 5 Best Online Sites To Convert YouTube Videos To MP3

In case you encounter any issues with your Exchange Server and database, you can take the help of exchange recovery applications, like Stellar Repair for Exchange. It can recover Exchange database, from any version and of any size. You can granularly export the user mailboxes, user archives, disabled mailboxes, shared mailboxes, and public folders to PST and other file formats. You can use the application to directly export to a live Exchange Server database or Exchange Online with features, such as automatic mailbox matching, parallel exports, and priority exports.

Ravi SinghAbout the Author:

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 recovery, 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 traveller who loves hiking and exploring new trails.

Find Me On LinkedIn

You Like It, Please Share This Recipe With Your Friends Using...

2 Responses to “How To Use Add-MailboxDatabaseCopy Command In Exchange Server?”

  1. rx30 fit says:

    This is a great guide on using the Add-MailboxDatabaseCopy command in Exchange Server! The step-by-step breakdown makes it much easier to understand, especially for those new to Exchange Server management. I appreciate how you’ve explained the process clearly and provided useful insights for setting up mailbox database copies. Thanks for sharing this helpful resource!

    • EXEIdeas says:

      Welcome here and thanks for reading our article and sharing your view. This will be very helpful to us to let us motivate to provide you with more awesome and valuable content from a different mind. Thanks again.

Leave a Reply

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