Collapsing DAG Networks Using Exchange 2010 Shell…

MS Exchange

Exchange admins working for medium to large companies would have come across the process of “Collapsing the DAG Network”. This is very important in deployments where there are no stretched subnets across datacentres. In this case, Exchange will pick up four DAG networks (one MAPI and one replications subnet per datacentre). Collapsing these four subnets into two (one MAPI and one replication) is important in making sure that the replication traffic is routed through the replication network. Otherwise, irrespective of whether you have a dedicated VLAN for replication or not, Exchange will always use the MAPI network.

Let me explain with an example. We have a DAG named DAG1 across two datacentres and there is no stretched subnets or VLANs. Hence, Exchange will create a DAG network for each subnet it finds. The below table shows the four subnets we have.

Network Subnet
DAG Network01 192.168.100.0/24
DAG Network02 10.0.1.0/24
DAG Network03 192.168.200.0/24
DAG Network04 10.0.2.0/24

The 192 subnet represents the production network (MAPI) and the 10 subnet represents the dedicated replication network.

In order to collapse and tidy up the DAG networks, we need to run the following commands.

Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork01 -Subnets 192.168.100.0/24,192.168.200.0/24

Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork02 -Subnets 10.0.1.0/24,10.0.2.0/24

Remove-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork03

Remove-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork04

Now, lets rename the networks from DAGNetwork01 & 02 to something meaningful, like MAPI and Replication.

Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork01 -Name MAPI

Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork02 -Name Replication

The following command will disable replication traffic through the MAPI network.

Set-DatabaseAvailabilityGroupNetwork DAG1MAPI –ReplicationEnabled $false

These commands will come in handy if you are scripting your Exchange deployment, a common practice in  large organizations.

Other Popular Articles


MS Exchange

Scripting Agent Initialization Failed: “File is not found” Error During Exchange 2016 Setup

MS Exchange

EAC Access While Co-Existing Exchange 2013 With 2010

MS Exchange

Delete All Calendar Entries In An Exchange 2010 Mailbox

Leave a Comment