How To : Configure DAG for Exchange Server 2013/2016/2019

  Exchange Server, Windows

***One witness server along with Active Directory role.
***Two Exchange 2016 Servers.

Go to domain controller > Active Directory Users and Computers > Builtin > Administrators > Add Exchange Trusted Subsystem to Administrators

Go to witness server, create witness folder and assigned permission for only administrators

Next, go to database availability groups

Add new database availability group > click Save

click manage database availability group membership > add servers member

Task will install Windows Failover Clustering automatically

Completed

DAG group is now added

Next, is setup DatacenterActivationMode to “DAGOnly”. Run the following Exchange Management Shell cmdlet to set DatacenterActivationMode

Set-DatabaseAvailabilityGroup -Identity DAG -DatacenterActivationMode DagOnly

Next, select Exchange Server 2 database, click Add database copy

Specify Mailbox server to copy to Exchange server 1

After Save, seeding is now running. PLEASE WAIT until complete!!! If database size is large or sync via VPN or WAN it might take sometime to complete.

Completed

***Repeat above task for Exchange server 1 databse for database copy to Exchange server 2

Once done, you will see both Exchange database in SERVERS WITH COPIES is sync between both side

To check the sync status:

Go to any Exchange server open Exchange Management Shell > Type Ge-MailboxDatabaseCopyStatus

***Please take noted as below task

1. Go to Servers > Virtual Directories > Change all URL to same directories

2. Add record to domain controller DNS (Please add only after exchange server is completed sync)

mail.titancloud.com.my A 1.1.1.1 – local exchange server 1 IP

mail.titancloud.com.my A 2.2.2.2 – local exchange server 2 IP

autodiscover.titancloud.com.my A 1.1.1.1 – local exchange server 1 IP

Autodiscover.titancloud.com.my A 2.2.2.2 – local exchange server 2 IP

3. Add record to Public DNS services like cloudflare or others
(Please add only after exchange server is completed sync)

mail.titancloud.com.my A 11.11.11.11 – local exchange server 1 WAN IP

autodiscover.titancloud.com.my A 11.11.11.11 – local exchange server 1 WAN IP

mail.titancloud.com.my A 22.22.22.22 – local exchange server 2 WAN IP

autodiscover.titancloud.com.my A 22.22.22.22 – local exchange server 2 WAN IP

Please noted that you also need to add PTR, MX and SPF for both Exchange serverin Public DNS server

4. Go to firewall port-forwarding for all Exchange server to WAN

Port to open for mail server: 25, 110, 143, 445, 587, 993, 995, 2525, 443

5. Go to mail flow > send connectors > edit > scoping > add secondary exchange into send connector
(Please add only after exchange server is completed sync)

Done!!!