The initial setup and configuration of a Database Availability Group (DAG) is done using a single cmdlet named New-DatabaseAvailabilityGroup
. In this recipe, we'll take a look at how you can automate the creation of a DAG using the Exchange Management Shell.
To create a DAG, use the New-DatabaseAvailabilityGroup
cmdlet
:
New-DatabaseAvailabilityGroup -Name DAG ` -WitnessServer HC1 ` -WitnessDirectory C:\FSW ` -DatabaseAvailabilityGroupIPAddresses 192.168.1.55
The previous command creates a new Database Availability Group named DAG
. The file share witness server is set to a hub transport server named HC1
, and the path for the directory is also specified, along with an IP address that will be used only by the DAG cluster resources.