The following examples are available from the official website for different scenarios for creating dags
The following example creates a DAG named DAG1, which is configured to use the witness server FILESRV1 and the local Direc Tory C:\DAG1. DAG1 is also configured to use DHCP for the DAG ' s IP addresses.
New-DatabaseAvailabilityGroup -Name DAG1 -WitnessServer FILESRV1 -WitnessDirectory C:\DAG1
The next example creates a DAG named DAG2. For the DAG ' s witness server, the system automatically selects a Exchange server with Client Access services In the local Active Directory site. DAG2 is assigned a single static IP address because in this example all DAG members has the MAPI network on the same subn Et.
New-DatabaseAvailabilityGroup -Name DAG2 -DatabaseAvailabilityGroupIPAddresses 10.0.0.8
This example creates the DAG DAG3. DAG3 is configured to use the witness server MBX2 and the local directory C:\DAG3. DAG3 is assigned multiple static IP addresses because it DAG members be on different subnets on the MAPI network.
New-DatabaseAvailabilityGroup -Name DAG3 -WitnessServer MBX2 -WitnessDirectory C:\DAG3 -DatabaseAvailabilityGroupIPAddresses 10.0.0.8,192.168.0.8
This example creates the DAG DAG4 that's configured to use DHCP. In addition, the witness server would be automatically selected by the system, and the default witness directory would be CR Eated.
New-DatabaseAvailabilityGroup -Name DAG4
This example creates the DAG DAG5 that would not have a administrative access point (valid for Windows Server) R2 DAGs only). In addition, MBX4 is used as the witness server for the DAG, and the default witness directory would be created.
New-DatabaseAvailabilityGroup -Name DAG5 -DatabaseAvailabilityGroupIPAddresses ([System.Net.IPAddress]::None) -WitnessServer MBX4
To query whether a DAG group was created successfully
Get-DatabaseAvailabilityGroup <DAGName> | Format-List
For more It information, you can also follow the public number below:
Zeng Hung Xin's online classroom, has hung Xin da Lecture hall-51CTO College
Http://edu.51cto.com/lecturer/639838.html
Exchange Server 2016 Management Series Courseware 46. Dag Managed PowerShell creation Dag