Creating a DAG in Exchange 2010 SP1 multi-tenant mode

After my posts about Exchange multi-tenant or hosting mode I got a lot of questions about how to create Database Availability Group, or DAG, when running Exchange hosted. So I decided to dedicate a post on how to configure/create DAG using powershell.

Technically the below applies to any exchange setup but, since when running in hosting mode there is no more Exchange Management Console, it might be specially useful if you are trying to configure a DAG while running exchange in multi-tenant mode.

The setup

For this article I am using 2 Exchange 2010 SP1 servers running the mailbox role in multi-tenant mode configured as below

Name LAN IP Replication network IP

Creating the DAG

I will start by creating the DAG using the New-DatabaseAvailabilityGroup cmdlet. The command below will create a DAG named: DDCDAG01 with an IP address of and use the server VSSHAREWIT as the share-witness.

New-DatabaseAvailabilityGroup -Name DDCDAG01 -WitnessServer VSSHAREWIT -WitnessDirectory C:\DDCDAG01Witness -DatabaseAvailabilityGroupIPAddresses

N.B.: If you get the warning “The Exchange Trusted Subsystem is not a member of the local Administrators group” however you did add the Exchange Trusted Subsystem group to the local Administrators group of your share witness to be, you can safely ignore this warning.

Adding the mailbox servers

After creating the Database Availability Group, it is now time to add the members to it. The below powershell commands will add Mailbox Servers VSMBX1 and VSMBX2 to the newly created DAG DDCDAG01

Add-DatabaseAvailabilityGroupServer DDCDAG01 -MailboxServer VSMBX1
Add-DatabaseAvailabilityGroupServer DDCDAG01 -MailboxServer VSMBX2

Managing DAG Networks

Another useful thing to learn is how to manage the DAG networks using powershell, running the powershell command Get-DatabaseAvailabilityGroupNetwork will return the automatically configured DAG networks

I decided to change the DAG networks to something more intuitive, so instead of DAGNetwork01 and DAGNetwork02 I renamed them MAPI and Replication using the Set-DatabaseAvailabilityGroupNetwork cmdlet. The full commands and their results are shown below

Adding Mailbox Database Copies

The final step in your DAG setup is to create copies of your mailbox databases on the other server. First a Get-MailboxDatabase will return the names of all mailbox databases that exists and where they are mounted.

Database copies can be added by using Add-MailboxDatabaseCopy, for example

Add-MailboxDatabaseCopy "Mailbox Database 0417769289" -MailboxServer VSMBX2

Will add a copy of the “Mailbox Database 0417769289” database to the VSMBX2 server

Finally a Get-MailboxDatabaseCopyStatus will show the status of the just replicated databases

That’s it, you are now ready to create your first DAG fully using powershell and without the help of the GUI

I have been working in IT consultancy and solution integration since 1998 and I consider myself lucky to be, one in a few, making a living out of my passion. I am also member of the famous Experts Exchange (profile here) online community where I try my best to share what I have learned along the road.

Posted in Messaging & Collaboration Tagged with: , , , , ,
One comment on “Creating a DAG in Exchange 2010 SP1 multi-tenant mode
  1. Adrian King says:

    Hi, does something need to be arranged with the Service Plans in this scenario, do they need to be copied to each dag member manually?

Leave a Reply

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