Sorry, you need to enable JavaScript to visit this website.

DAG in a Click

DAG in a Click
May 18, 2017

DAG is a set of upto 16 Exchange mailbox servers, automating recovery after a database, server, or network failure

If you are grappling with the protracted steps involved in creating a Database Availability Group (DAG), this blog might be of help.

It will discuss the salient points around developing a DAG as well as configuring it. Let us begin by understanding what a DAG is.

What is a DAG?

In simple words, a Database Availability Group or DAG is a high availability cluster and data recovery feature of Microsoft Exchange Server.

It is a set of exchange mailbox servers (to a maximum permissible limit of 16), which automates data recovery, following a database, server, or network failure.

Note: In this blog, I am focusing solely on creating and configuring a DAG in a Click.

Pre-requisites for creating a DAG:

You need to install—

  • Windows Server 2008 R2 or Windows Server 2012 R2, depending on the number of members/nodes you want to add in the DAG.
  • One server with same OS for file share witness usage.
  • One server with installed Active Directory.

While deploying and configuring a DAG in a Click, multiple servers are required to reboot. This enables you to run the commands from another machine using PsExec utility.

Note: PsExec is Microsoft’s light-weight telnet-replacement that lets you execute processes on variant systems, complete with sufficient interactivity for console applications, without having to manually install client software.

Steps to Create and Configure a DAG in a Click:

Now, let’s initiate the DAG in a Click configuration process through effective commands which can be used in a single script file.

Step1: Install all the appropriate pre-requisites using the following command for Windows Server 2008 R2 or Windows Server 2012 R2:

psexec \\ -u administrator -p paswd@123 cmd /c  "C:\ filterpack2010sp1-kb2460041-x64-fullfile-en-us.exe " /quiet

Steps2: Prepare the Active directory using the following command:

.\Setup.exe /PrepareAD /OrganizationName:Org_Name /IAcceptExchangeServerLicenseTerms

Step3: Install Microsoft Exchange Server 2013 with Client Access and Mailbox roles on all DAG members and witness servers using the specified command:

.\Setup.exe /mode:Install /role:ClientAccess,Mailbox /OrganizationName:Org_Name /IAcceptExchangeServerLicenseTerms

Successful installation of Exchange Server will display a message as shown in the screenshot below:

Step4: Create and configure the DAG using the following set of commands:

DAGs leverage the concept of incremental deployment, which is the ability to utilize service and data availability for all Mailbox servers and databases after Exchange is installed. After deploying the Exchange Mailbox servers, the commands create a DAG, add Mailbox servers to the DAG, and bolster replication of mailbox databases between the DAG members.

  • Add the Exchange Trusted Subsystem, Exchange Windows Permissions, Exchange Servers groups  in Active Directory to the local Administrator group on the server using the following commands:
$comp = Get-ADComputer Org_name

$sid = (Get-ADGroup "Exchange Trusted Subsystem").sid

$rights = [System.DirectoryServices.ActiveDirectoryRights]::GenericAll

$perm = [System.Security.AccessControl.AccessControlType]::Allow

cd ad:

$acl = get-acl $comp

$ace = new-object System.DirectoryServices.ActiveDirectoryAccessRule $sid, $rights, $perm


set-acl -AclObject:$acl -path:$comp
  • Add the members in DAG using the following command:

Add-DatabaseAvailabilityGroupServer -Identity Org_Name -MailboxServer member1

  • Copy the Databases using the following command:

Add-MailboxDatabaseCopy -Identity DB1 -MailboxServer member1 -ActivationPreference 2

After the completion of Step 4, your DAG will be ready for recovery at the database level in case of any database, server, or network failure.