Set-DatabaseAvailabilityGroup
cmdlet is used to configure certain Database Availability Group (DAG) settings that cannot be done through Exchange Admin Center (EAC) or Exchange Management Console (EMC). With this cmdlet, you can perform operations such as changing TCP port, changing Witness server or directory, blocking cross-site RPC access, etc.
Set-DatabaseAvailabilityGroup
The tool lets you manage operations such as configuring the DAG's network discovery processes, specifying the TCP port used for replication, and enabling Data Center Activation Coordination (DAC) mode. The values for these properties are stored in both Active Directory and the cluster database. In particular, you must have a core configuration of the cluster structure underlying the DAG to manage operations such as network compression, network encryption, and network discovery.
Database Availability Group (DAG) Values
The values for Database Availability Group (DAG) properties are stored in both Active Directory and the cluster database. This requires the DAG configuration to integrate with both Active Directory, which provides authentication and policy management, and the cluster database, which coordinates server-to-server interactions.
Because some properties are stored specifically in the cluster database, it is important that the DAG has the necessary core configurations to manage the underlying cluster. These configurations include:
- ReplicationPort: Specifies the network port used for data replication between DAG members.
- NetworkCompression: Controls whether data compression will be used over the network during data replication.
- Network Encryption: Sets whether to encrypt replication data on the network.
- DiscoverNetworks: Allows DAG to automatically discover available networks.
Set-DatabaseAvailabilityGroup Usage Areas
In your setup, Witness directory and server settings are a key part of your DAG configuration. These settings ensure that the high availability and durability features of the DAG work correctly.
Setting Witness Index with Set-DatabaseAvailabilityGroup
If you want to set the Witness index for a specific DAG, you can use the following command:
Set-DatabaseAvailabilityGroup -Identity DAG1 -WitnessDirectory C:DAG01
Setting Witness Server and Witness Directory with Set-DatabaseAvailabilityGroup
To set or change the Witness server and directory, you can use the following set of commands:
Set-DatabaseAvailabilityGroup -Identity <DatabaseAvailabilityGroupIdParameter> -WitnessServer <FileShareWitnessServerName> -WitnessDirectory <FullPath>
If the current Winess server fails or causes problems, you can use the following command to specify an alternative Winess server:
Set-DatabaseAvailabilityGroup -Identity "DatabaseAvailabilityGroupParameter" -AlternateWitnessDirectory <NonRootLocalLongFullPath> -AlternateWitnessServer <AlternateWitnessServerName>
Using DHCP in DAG Configuration with Set-DatabaseAvailabilityGroup
To enable your DAG member servers to obtain IP addresses automatically, you can use the following command:
Set-DatabaseAvailabilityGroup -Identity "DatabaseAvailabilityGroupParameter" -DatabaseAvailabilityGroupIpAddresses "IPAddress"
Enabling DAC Mode with Set-DatabaseAvailabilityGroup
To enable Database Activation Coordination (DAC) mode, the following command can be used. This mode regulates database connection behavior when the DAG is started and helps prevent unwanted database copy activations:
Set-DatabaseAvailabilityGroup -Identity "DatabaseAvailabilityGroupParameter" -DatacenterActivationMode "DatacenterActivationModeOption"