In this tutorial I will walk you through the installation of an Exchange Server 2016 database availability group. For this example a DAG with two members in the same site is being created, with a third Windows server in the same site being used as the file share witness.

exchange-2016-dag-01

To prepare for the new database availability group I’ve installed two Exchange 2016 servers with identical hardware, storage and performance specifications. When each server was installed, Exchange setup created a default mailbox database. I’ve already renamed the databases to unique names, and moved them to storage paths ready to replicate between the two DAG members.

[PS] C:\>Get-MailboxDatabase | fl name,edbfilepath,logfolderpath

Name          : DB05
EdbFilePath   : E:DB05DB05.edb
LogFolderPath : F:DB05

Name          : DB06
EdbFilePath   : E:DB06DB06.edb
LogFolderPath : F:DB06

I have also prepared the file share witness server by adding the Exchange Trusted Subsystem group to the local Administrators group of the server.

exchange-2016-dag-install-01

In this example I’m creating a database availability group with no cluster administrative access point (CAAP). The DAG has no IP address of its own, and no computer object in Active Directory. The main implication of this is that backup software that relies on the CAAP for backup operations won’t work. As this option of an IP-less DAG was first introduced in Exchange Server 2013 SP1/CU4, so by now any decent backup product should support this configuration. But you should always verify this with your backup vendor of choice. Also be aware that this is only supported for DAGs that are running on Windows Server 2012 R2 (or later).

To create the new DAG from the Exchange Management Shell we run New-DatabaseAvailabilityGroup, providing the name for the DAG and also specifying the name of the file share witness server. I’m also specifying the filesystem for the DAG because my Exchange 2016 servers are using ReFS for their data volumes.

[PS] C:\>New-DatabaseAvailabilityGroup -Name EX2016DAG01 -WitnessServer mgmt.exchangeserverpro.net -FileSystem ReFS

Name             Member Servers                                      Operational Servers
----             --------------                                      -------------------
EX2016DAG01      {}

The new DAG object has now been created, but it doesn’t have any members yet. Next we add our Exchange 2016 servers to the DAG.

[PS] C:\>Add-DatabaseAvailabilityGroupServer -Identity EX2016DAG01 -MailboxServer EX2016SRV1

Repeat the previous step for the other DAG members as well.

[PS] C:\>Add-DatabaseAvailabilityGroupServer -Identity EX2016DAG01 -MailboxServer EX2016SRV2

The DAG now has two members.

[PS] C:\>Get-DatabaseAvailabilityGroup EX2016DAG01 -Status

Name             Member Servers                                      Operational Servers
----             --------------                                      -------------------
EX2016DAG01      {EX2016SRV2, EX2016SRV1}                            {EX2016SRV1, EX2016SRV2}

The DAG’s file share witness is the server that was specified at the time of creation, MGMT, and the default witness directory has been configured by Exchange.

[PS] C:\>Get-DatabaseAvailabilityGroup EX2016DAG01 -Status | fl *witness*

WitnessServer             : mgmt.exchangeserverpro.net
WitnessDirectory          : C:DAGFileShareWitnessesEX2016DAG01.exchangeserverpro.net
AlternateWitnessServer    :
AlternateWitnessDirectory :
WitnessShareInUse         : Primary

On the witness server itself you can see the witness directory has been created and populated.

exchange-2016-dag-witness

Now that the Exchange Server 2016 database availability group has been created we can proceed with adding database copies.

[adrotate banner=”49″]

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Cole Byrne

    Thanks for sharing this! All the best!

  2. Mohamed Elmasry

    Hello Paul,
    I have a problem after we configured the Dag for the firewall publishing rules I replaced the original EXchange IP with the witness server IP.
    We receive Emails but we cannot send.

    Is something wrong configured here ?

    Thanks In Advance,…

  3. Gladys Kelsey

    Enjoyed reading this, very good stuff, thanks.

  4. Julien

    Hello Paul,

    Thanks for all the articles, they helped me to update my knowledge.

    But I’m facing an Exchange 2016 installation done by a supplier and I had to resolve all bad things he did.

    We have here a DAG of 2 Exchange 2016 updated to CU12
    The DAG is IP-Less

    In this case, how it works:
    – When we place one of the two server in maintenance mode ? Without a unique IP, how is it supposed to balance the traffic to the available node ?
    – Almost the same question for the non outlook client, how are we supposed to configure them ? With an IP of only one node ? But in this case, there will be no high availability ?

    Thanks for you support

    1. Julien

      To answers my own question, the advice is to use the DNS round robin solution in case you do not have a failover solution in front of your IP-Less DAG

  5. Kevin

    Currently I have three sites and each site has DAG with two Exchange 2016 CU 10 servers; running on ESXI 6.0 hosts. Wanting to create another Exchange server for each site and add in a 3rd Exchange 2016 CU 10 server and add one to each DAG. My question is once I do this the need for the witness server is removed; do I need to remove the witness server?

  6. Steve

    ah ha ! i want to setup dag, i have one exchange 2016 server, so i see here the other server just needs to be a member server ??? i am petrified of playing around with my exchange server !!! hopeit all goes well.

  7. Jide

    Hi Paul,
    Is there a way to create an IP-Less DAG in Exchange 2016 without having the error “object reference not set to an instance of an object”?
    I have tried everything i saw on the in internet. I have checked from PowerShell and the DAG appears to be perfectly fine but this error in ECP is annoying.
    I’m just thinking that maybe it’s giving the error given that there’s no Administrative Point to manage the cluster.

  8. Rae

    Is there a way to expand the volume capacity where the database of exchange stored? And when the server where exchange installed and is configured with raid 5?

  9. Jan

    Hello. I have a problem
    I have installed 2x Exch 2016 on server 2012 (name WIN-EXCH5 and WIN-EXCH6) 🙂
    The third server (WIN-BACKUP) is only the replicated AD, and DNS server.

    Servers are available, the Administrator has an Exchange Trusted Subsystem member.
    I was able to create DAG:

    New-DatabaseAvailabilityGroup -Name EX2016DAG01 -WitnessServer WIN-BACKUP.mydomain.com -FileSystem ReFS

    This is OK.

    [PS] C: \ Windows \ System32> Get-DatabaseAvailabilityGroup EX2016DAG01 -Status

    Name Member Servers Operational Servers
    —- ————– ——————-
    EX2016DAG01 {}

    But:
    Add-DatabaseAvailabilityGroupServer -Identity EX2016DAG01 -MailboxServer WIN-EXCH5
    and
    Add-DatabaseAvailabilityGroupServer -Identity EX2016DAG01 -MailboxServer WIN-EXCH6

    I have a mistake:
    WARNING: The operation was not successful because an error was encountered. You may find more details in the log file
    “C: \ ExchangeSetupLogs \ DagTasks \ dagtask_2018-08-07_14-53-17.581_add-databaseavailabiltygroupserver.log” on “WIN-EXCH6”.
    A server-side database availability group administrative operation failed. Error Failed to add or remove the Failover-C
    lustering feature. Error: ArgumentNotValid: The role, role service, or feature name is not valid: ‘Failover-Clustering’
    . The name was not found.
    . [Server: WIN-EXCH6.mydomain.com]

    Do I have to install Failover-Clustering?
    WIN-BACKUP must have an Edge Transport server role installed?

  10. Saigon

    Hi Paul,

    Nice post.
    I have a question for you, can Exchange 2016 (server 2016) have multi-domain DAG members?

    Thank you in advance.

  11. Ahsan

    Hello Paul,

    If there any possibility where I can have more than 1 witness in Exch 2016 DAG.?

  12. Chris Lehr

    Hey Paul.. long time listener.. I recently did this, and it kept failing on the second server, and seemed to never touch the FSW. I was specifying folder, and I dropped that, but at the same time I also added Exchange Servers to the local admin on the FSW. Not sure which of the two things (or the combo) is what helped, but I was getting an error that the server was added to the DAG, but not the cluster.

    Also technet says to do IP less, you should specify the network like this:
    -DatabaseAvailabilityGroupIPAddresses ([System.Net.IPAddress]::None)

    Source: https://technet.microsoft.com/en-us/library/dd351172(v=exchg.160).aspx

    I found that when I didn’t do that, a computer object with the DAG name was still appearing.

  13. Oscar

    Hi Paul,

    Great information here, but I have a question.
    I have 3 servers in a DAG (Exchange 2016), 2 of them are active with balanced databases in the subnet, let’s say 2.2.2.x and the 3rd is the DR server in subnet 2.3.2.x.

    The FSW was configured in a server in subnet 2.2.2.x as well as my active servers.

    When performing a DR Test, we shutdown the 10G that carries 2.2.2.x , of course we lost the FSW and the active servers, but the DR server never came up, I’m assuming this happened because there was nobody who tell him what to do, DBs went to unknown.

    If I’m right, what would be the best option to solve this?
    I’m thinking to move the FSW to a server in 2.3.2.x since this path is only for DR, or configure an alternate FSW, however I haven’t found if alternate FSW is an option for Exchange 2016.

    Thanks and regards.

    1. Avatar photo
      Paul Cunningham

      What you need to do is go lookup the concept of quorum as it applies to database availability groups, and also read up on what a datacenter switchover is.

      Short answer, your DR site won’t come online automatically because it can’t achieve quorum by itself. This is normal.

  14. Samy

    Hi Paul,
    Thank for the excellent article again
    In a DAG environment, is it necessary to configure the second server identical to first server such as Receive/Send Connectors, accepted domains etc.

    1. Avatar photo
      Paul Cunningham

      Accepted domains are an organization-level setting, you don’t need to configure them per-server.

      Send connectors depends on whether you want both servers to participate in outbound email. Normally I’d say that you should have one send connector and add *both* servers as source servers, so that both will handle outbound mail.

      For receive connectors, the servers will be automatically configured with a series of receive connectors used for inbound and internal email. If you have extra requirements for internal devices and apps to use SMTP relay to external recipients, then you’ll need to create an additional relay connector. If you want both servers to be able to relay for those internal devices and apps, then both will need the relay connector created.

  15. Ahmed Shaaban

    hello paul..please note that the powershell cmdlet you used will create a DAG configured to use DHCP.the correct syntax to create ip-less DAG is: new-databaseavailabilitygroup -Name DAG5 -DatabaseAvailabilityGroupIPAddresses ([System.Net.IPAddress]::None)

  16. Dario ZUGCIC

    Dear Paul,

    this article made me through Test environment and it all worked fine.

    Problem started when I installed servers in Production and tried to join second server to DAG.
    I am getting: “Error: Cluster API failed: “AddClusterNode() (MaxPercentage=12) failed with 0x800706a7. Error: The RPC protocol s
    equence is not supported”.“

    Do you have idea how to solve this problem?

    Thanks,
    Dario

  17. Kyle

    Paul

    As always, great articles.

    I have a situation that you might be able to offer guidance on. I have setup a new E16CU5 lab environment (done this a couple of times to iron out my settings) and I created a new DAG through the ECP. When I add members it reports back as failed. I then reboot the potential DAG members and they finish installing part of the failover clustering components. Once rebooted, I can successfully add those members to the DAG without issue.

    Did I miss something in the pre-reqs regarding the failover clustering or is this expected behavior?

    thanks
    Kyle

    1. Avatar photo
      Paul Cunningham

      Adding a DAG member automatically installs and configures failover clustering. I’ve occasionally seen the same behavior but it hasn’t stopped me from adding the DAG member on a second attempt. There might have been some other issue like a pending restart. If it works fine after a reboot, then perhaps the only lesson to take from it is that a reboot before you add the DAG member might be a good idea.

  18. Robatwork

    Super article.

    As a newcomer to Exchange can i just thank you for all your articles which have proved very useful. If I may I would like to ask a pretty basic question. Is DAG the best (and recommended) method of having a hot/warm spare for Exchange?

    I am running a server for just 30-40 users but we do rely on email a lot so can’t afford too much downtime. I do backup but want something I can get back online within an hour if it goes pop.

    cheers

  19. Tim Jahr

    Is it possible for an Exchange server to be a member of more than 1 DAG? We only have 2 Exchange servers (plus a separate FSW server) – so does that mean I can only have 1 DAG? We had considered separates ones for employee, staff, misc – but maybe there’s no benefit to that if they’re just replicating to the same 2 places?

  20. Marc Simoneau

    Hi Paul, thanks for your time and effort in creating these tutorials. Greatly appreciated.

    Just wondering if there are specific steps on adding disks to a IP-less DAG? I have initialized and created partitions after the Dag was created with powershell because I have to complete mailbox migrations in a staged manner due to storage constraints. When I restart the server the newly added disk goes offline? The disks that were present when the DAG was created are online after the restart. I’ve also set the storage setting newdiskpolicy to OnlineAll but this hasn’t helped. Must I somehow tell the cluster to manage the new disks?

      1. Marc Simoneau

        It’s SAN attached through VMware. It’s happening on two newly built Exchange 2016 CU 4 servers in two different VMware clusters. Quite odd. I can’t seem to find any documentation on adding storage to an already existing DAG, do you know of any? I’m left with recreating the DAG to see if the problem still exists.

        1. Avatar photo
          Paul Cunningham

          There’s no special steps that I’m aware of. Storage is managed by the OS. The DAG doesn’t offline/online storage volumes. The DAG does some storage management for auto-reseed scenarios, but that doesn’t involve keeping storage offline. I think you’ve got an underlying OS/VM issue.

  21. Christopher Milligan

    Paul absolutely AWESOME set of tutorials and has helped me no end in deploying 2016 on prem. One issue I did hit with the DAG was I had to create the CNO for the new DAG in my AD and add in the server accounts into the securities of that Computer account.

    I’m pretty sure I must have missed a step somewhere as you don’t mention it.

    Thanks again for the priceless tutorials, they are life savers.

    Much Appreciated

    1. Avatar photo
      Paul Cunningham

      If you’re creating a CNO that means you’re not creating an IP-less DAG, which is not the recommended approach (IP-less is recommended, and is the default for 2016). Yellow box in the article covers that point.

  22. Dave

    I’m planning on upgrading from a single Exchange 2010 Server (on a Windows 2008R2 box) to two Windows 2016 Servers each running Exchange 2016 in a DAG as you describe in this article. Any advice or tips on the best way to accomplish this? My Exchange 2010 box has 4 DB’s and about 200Gb of data and will be decommissioned after the migration.

    Cheers

  23. vijay kumar

    can u plzz suggest me a way to change my exchange server 2016 data base location
    without losing old data.. plzz asap.

    1. Avatar photo
      Paul Cunningham

      Create a new database in the new location, then move the mailboxes.

  24. pavnesh kumar

    i also had same issue i have resolved the issue.

    i moved all the arbitation mailboxes to exchange 2016 from 2013 and also moved administrator account mailbox to exchange server 2016.
    issue stand resolved

  25. grant

    I have this setup but I am noticing some strange things with the First server. Basically if i fail the first server at any point the second server does not automatically mount the db. The first server also spikes to 100% cpu usage and w3wp.exe goes into a crash loop on host1. I rebuilt the environment and it still continues. The first server only has the 1 db and i am wondering if i need some kind of generic placeholder DB for the first server so that it has some database to mount on boot when the second server has its db mounted?

    I have all of the virtual directories on each server mapped to the mail.domain.com/virtual directory and that host resolves to a load balancer that is monitoring both hosts. any suggestions on where the problem may lie? this is my first attempt at a dag.

    1. Avatar photo
      Paul Cunningham

      So you have one database, and that database has copies on both DAG members?

      Or does each DAG member have a separate database with no other copies?

      1. grant

        Originally I had 1 db with all mailboxes in it (test env so only 1 user mailbox and all of the system mailboxes). I had copies of that on both dbs.

        I now have 3 total dbs, 1 for each server that contains the generic system accounts (no copies anywhere) and then a 3rd with my test user that has a copy on both servers. The behaivor is the same. With both servers up its fine. Once i fail the first server (or reboot it) i can never get it to come back up. When it comes back online it is at 100% cpu utilization and the various iis application pools take turns failing rapidly. The only way to recover is to remove the database copies and remove the dag, then the first server behaives.

  26. nir cohen

    hi paul

    i need to implement a dag in my company …

    i have two exchange 2016 servers on 2012 r2 …

    i dont really understand the benefits of ip less dag …

    can you explain t for us ?

  27. Stefan Desira

    I have a new setup with two Exchange 2016 servers installed on Windows Server 2012 R2. I am looking to create a DAG with 2 members and 1 witness server.

    Can the witness server be a Windows Server 2008 R2 machine?

      1. John Sator

        In this scenario with 2 DAG members and 1 witness server – what happens if witness server goes down?

  28. Frindel

    Just install your exchange server and add it like member of the DAG with the command listed on top.
    PS] C:\>Add-DatabaseAvailabilityGroupServer -Identity EX2016DAG01 -MailboxServer EX2016SRVX

  29. Nuno Rodrigues

    Hi i have already one exchange 2016 working. It´s possible to create a second one and the witness and create a DAG? the exchange already running is domain controller and DHCP server.

  30. Alex MacDonald

    Hi Paul

    Ive setup my DAG but when I view the DAG in ECP I get a message on the right hand side saying “Object reference not set to an instance of an object”. All it says is in there is “Witness Server”. My Witness Server seems all OK as i can see the log files in teh share have been created.

    I also want to ensure that the replciation traffic goes between my Ex2016 servers over a replication network I’ve created. As I can;t see what networks the DAG is uing in the ECP, how do I configure this? Do I use the “New-DatabaseAvailabilityGroupNetwork” command?

    Thanks
    Alex

    1. B. Wieczorek

      @Alex Try to use a Get-DatabaseAvailabilityGroupNetwork at first. Normally such a network should already exists and you need to enable / disable the replication via Set-DatabaseAvailabilityGroupNetwork. So no new network must be created.

      1. Alex MacDonald

        Hi

        I am still getting the “Object reference not set to an instance of an object” error message in the EAC information area on the right hand side when I view the Database Availability Group in EAC.

        I used the following command to ensure my mapi network does not handle any of the replication traffic,
        Set-DatabaseAvailabilityGroupNetwork -Identity DAG01MapiDagNetwork -ReplicationEnabled:$false

        All seems correct when I run,
        Get-DatabaseAvailabilityGroupNetwork DAG01

        I get,
        Identity ReplicationEnabled Subnets
        ——– —————— ——-
        DAG01MapiDagNetwork False {{10.1.0.0/16,Up}}
        DAG01ReplicationDagNetwork01 True {{172.16.0.0/16,Up}}

        Any ideas?

    2. filip

      I have got the same ecp error on dag “Object reference not set to an instance of an object”.
      How did you fix It?

      1. Alex MacDonald

        Fixed: The binding order of the adapters is important, make sure that the adapter used for MAPI traffic is at the top if you have configured a MAPI network and a separate REPL network,

        1. Go into the Network Connections window and you should see 2 NICs. One is the MAPI adapter and the other is the Replication adapter
        2. Press ALT and select Advanced>Advanced Settings
        3. Select the MAPI network adapter
        4. Press the UP arrow on the right hand side
        5. Restart ECP and now when you select the DAG it displays all the information about the DAG, Witness Server and DAG Network as it’s supposed too

        Cheers

        1. Asdrúbal Veloz

          I have only one adapter and i got the same issue, any ideas?

  31. Isaac Biju

    Good article and easy to follow !!

    In Exchange 2016, how can we configure IP for DAG.
    In Exchange 2016 we could not see any option to have DAG IP.

  32. Oleg

    Hello,

    Great article! I just have one quick question. I’m getting ready to install Exchange 2016 in my production environment and I’m wondering if I would still need to create a separate network for DAG replication? I know that when Exchange 2010 was introduced Microsoft recommended creating a separate network for that and not replicating the data over the LAN. Is this still the case?

    1. Avatar photo
      Paul Cunningham

      Microsoft’s “Preferred Architecture” documents for Exchange 2013 and 2016 recommend a single network for DAGs.

      There has never been a hard requirement for separate replication networks. It’s always been optional.

  33. Mike

    Would be interested in seeing this same type of post for 2 sites with a single DAG and 4 members. I would also be interested in seeing where the Alternate Witness comes into play as I don’t fully understand it’s role.

  34. Raman

    Hello Paul,
    Thanks for the article.
    I am installing Exchange 2016 in Test lab. Since now all the Exchange 2016 servers have mailbox role as well is it possible that I could make one of the Exchange 2016 server as witness server? Or it would not let me do it? Since, there is no option to install only CAS role which could also server as witness server (as it was possible with Exchange 2013).

    Thanks,

    1. Avatar photo
      Paul Cunningham

      The Witness server does not need to be an Exchange server, it only needs to be a Windows server that can host a file share. In a test lab you can just use your domain controller. It’s supported to use a domain controller as the FSW, just not recommended in production.

  35. Taiwo Bada

    Absolutely brilliant!!!!…
    I have setup my LAB following all your steps and all looks fine to this point 🙂

Leave a Reply