Set-DatabaseAvailabilityGroup
Applies to: Exchange Server 2010
Topic Last Modified: 2011-03-19
Use the Set-DatabaseAvailabilityGroup cmdlet to configure some of the properties of a database availability group (DAG). The Set-DatabaseAvailabilityGroup cmdlet cannot be used to manage DAG membership; instead, you must use the Add-DatabaseAvailabiltyGroupServer or Remove-DatabaseAvailabiltyGroupServer cmdlets to manage DAG membership. This cmdlet enables you to manage DAG properties that cannot be managed from the Exchange Management Console, such as the IP address(es) assigned to the DAG, network discovery, the TCP port used for replication, and datacenter activation coordination (DAC) mode.
DAG property values are stored in both Active Directory and the cluster database. However, some properties are stored on in the cluster database. As a result, the underlying cluster for the DAG must be up and running and have quorum in order to set the properties for:
-
ReplicationPort
-
NetworkCompression
-
NetworkEncryption
-
DiscoverNetworks
Set-DatabaseAvailabilityGroup -Identity <DatabaseAvailabilityGroupIdParameter> [-AlternateWitnessDirectory <NonRootLocalLongFullPath>] [-AlternateWitnessServer <String>] [-Confirm [<SwitchParameter>]] [-DatabaseAvailabilityGroupIpAddresses <IPAddress[]>] [-DatacenterActivationMode <Off | DagOnly>] [-DiscoverNetworks <SwitchParameter>] [-DomainController <Fqdn>] [-NetworkCompression <Disabled | Enabled | InterSubnetOnly | SeedOnly>] [-NetworkEncryption <Disabled | Enabled | InterSubnetOnly | SeedOnly>] [-ReplicationPort <UInt16>] [-WhatIf [<SwitchParameter>]] [-WitnessDirectory <NonRootLocalLongFullPath>] [-WitnessServer <String>]
| Parameter | Required | Type | Description |
|---|---|---|---|
|
Identity |
Required |
Microsoft.Exchange.Configuration.Tasks.DatabaseAvailabilityGroupIdParameter |
The Identity parameter specifies the name of the DAG to be modified. |
|
Confirm |
Optional |
System.Management.Automation.SwitchParameter |
The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch. |
|
DatacenterActivationMode |
Optional |
Microsoft.Exchange.Data.Directory.SystemConfiguration.DatacenterActivationModeOption |
The DatacenterActivationMode parameter specifies whether data center activation mode is disabled (Off) or enabled for the DAG (DagOnly). This mode should be set for all DAGs with three or more members that are extended to two or more physical locations. This mode cannot be enabled for DAGs with fewer than three members. |
|
DiscoverNetworks |
Optional |
System.Management.Automation.SwitchParameter |
The DiscoverNetworks parameter is used to force a rediscovery of the network and network interfaces. By default, internal network heartbeats are sent between DAG members on the same subnet. If there is no response to the heartbeats, network discovery is performed automatically by the system. If you add or remove networks or change DAG network subnets, you can force rediscovery of all DAG networks by using the DiscoverNetworks parameter. |
|
DomainController |
Optional |
Microsoft.Exchange.Data.Fqdn |
The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory. |
|
NetworkCompression |
Optional |
Microsoft.Exchange.Data.Directory.SystemConfiguration.DatabaseAvailabilityGroup+NetworkOption |
The NetworkCompression parameter specifies whether network compression is disabled on all networks (Disabled), enabled on all networks (Enabled), enabled for inter-subnet communication only (InterSubnetOnly), or enabled only for seeding (SeedOnly). |
|
NetworkEncryption |
Optional |
Microsoft.Exchange.Data.Directory.SystemConfiguration.DatabaseAvailabilityGroup+NetworkOption |
The NetworkEncryption parameter specifies whether network encryption is disabled on all networks (Disabled), enabled on all networks (Enabled), enabled for inter-subnet communication only (InterSubnetOnly), or enabled only for seeding (SeedOnly). |
|
ReplicationPort |
Optional |
System.UInt16 |
The ReplicationPort parameter specifies a Transmission Control Protocol (TCP) port for replication (log shipping and seeding) activity. If this parameter is not specified, the default port for replication will be TCP 64327. |
|
WhatIf |
Optional |
System.Management.Automation.SwitchParameter |
The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch. |
|
AlternateWitnessDirectory |
Optional |
Microsoft.Exchange.Data.NonRootLocalLongFullPath |
The AlternateWitnessDirectory parameter specifies the name of an alternate directory that is used to store file share witness data. The specified directory must not be in use by any other DAGs or used for any other purpose. This parameter is used only as part of a datacenter switchover process. If the DAG is extended across multiple datacenters in a site resilience configuration, we recommend pre-configuring the alternate witness server and directory. |
|
AlternateWitnessServer |
Optional |
System.String |
The AlternateWitnessServer parameter specifies the name of an alternate server that is used to store file share witness data. The specified server must not be a member of the DAG that is configured to use it. This parameter is used only as part of a datacenter switchover process. If the DAG is extended across multiple datacenters in a site resilience configuration, we recommend pre-configuring the alternate witness server and directory. |
|
WitnessDirectory |
Optional |
Microsoft.Exchange.Data.NonRootLocalLongFullPath |
The WitnessDirectory parameter specifies the name of the directory on the server that is used to store file share witness data. The specified directory must not be in use by any other DAGs. |
|
WitnessServer |
Optional |
System.String |
The WitnessServer parameter specifies the name of a server that will act as a witness for the DAG. The server specified cannot be a member of the DAG. |
|
DatabaseAvailabilityGroupIpAddresses |
Optional |
System.Net.IPAddress[] |
The DatabaseAvailabilityGroupIpAddresses parameter is used to assign one or more static IP addresses to the DAG when a Mailbox server is added to a DAG. If you omit the DatabaseAvailabilityGroupIpAddresses parameter when creating a DAG, the system attempts to lease one or more IP addresses from a Dynamic Host Configuration Protocol (DHCP) server in your organization to assign to the DAG. You must specify this parameter each time an additional IP address is added to the DAG, such as in the case of multi-subnet DAGs. You must also specify all IP addresses previously assigned to the DAG each time the DatabaseAvailabilityGroupIpAddresses parameter is used. Setting the DatabaseAvailabilityGroupIpAddresses parameter to a value of 0.0.0.0 automatically configures the DAG to use DHCP. |
You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the"database availability group" entry in the High Availability Permissions topic.
| Error | Description |
|---|---|
|
Specified database availability group does not exist. |
Verify the name for the DAG and try the task again. |
|
Insufficient authority to perform the task. |
Verify that the account you are using has the proper permissions and try the task again. |
This example sets the witness directory to C:\DAG1DIR for a DAG named DAG1.
Set-DatabaseAvailabilityGroup -Identity DAG1 -WitnessDirectory C:\DAG1DIR
This example pre-configures an alternate witness server of EXHUB3 and an alternate witness directory of C:\DAGFileShareWitnesses\DAG1.contoso.com for a DAG named DAG1.
Set-DatabaseAvailabilityGroup -Identity DAG1 -AlternateWitnessDirectory C:\DAGFileShareWitnesses\DAG1.contoso.com -AlternateWitnessServer EXHUB3
This example configures a DAG named DAG1 to use DHCP to obtain an IP address.
Set-DatabaseAvailabilityGroup -Identity DAG1 -DatabaseAvailabilityGroupIPAddresses 0.0.0.0
This example configures a DAG named DAG1 to use a static IP address of 10.0.0.8.
Set-DatabaseAvailabilityGroup -Identity DAG1 -DatabaseAvailabilityGroupIPAddresses 10.0.0.8
This example configures a multi-subnet DAG named DAG1 with multiple static IP addresses.
Set-DatabaseAvailabilityGroup -Identity DAG1 -DatabaseAvailabilityGroupIPAddresses 10.0.0.8,10.0.1.8
This example configures TCP port 63132 as the port used by replication for a DAG named DAG1.
Set-DatabaseAvailabilityGroup -Identity DAG1 -ReplicationPort 63132
Note: |
|---|
| After changing the default replication port for a DAG, you must manually modify the Windows Firewall exceptions on each member of the DAG to allow communication to occur over the specified port. |
This example configures a DAG named DAG1 for datacenter activation mode.
Set-DatabaseAvailabilityGroup -Identity DAG1 -DatacenterActivationMode DagOnly

Note: