Commands › Exchange Online

Set-DatabaseAvailabilityGroup

Exchange Online ExchangeOnlineManagement Set-*

Configure properties of a database availability group (DAG).

Quick start script

# Set-DatabaseAvailabilityGroup — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-DatabaseAvailabilityGroup
$before | Format-List

# 3. Make the change (dry run first)
Set-DatabaseAvailabilityGroup -Identity <DatabaseAvailabilityGroupIdParameter> -WhatIf
Set-DatabaseAvailabilityGroup -Identity <DatabaseAvailabilityGroupIdParameter>

# 4. Verify and diff
$after = Get-DatabaseAvailabilityGroup
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-DatabaseAvailabilityGroup [-Identity] <DatabaseAvailabilityGroupIdParameter>
 [-ActivityState <ActivityStateOption>]
 [-AllowCrossSiteRpcClientAccess]
 [-AlternateWitnessDirectory <NonRootLocalLongFullPath>]
 [-AlternateWitnessServer <FileShareWitnessServerName>]
 [-AutoDagAllServersInstalled <Boolean>]
 [-AutoDagAutoRedistributeEnabled <Boolean>]
 [-AutoDagAutoReseedEnabled <Boolean>]
 [-AutoDagBitlockerEnabled <Boolean>]
 [-AutoDagDatabaseCopiesPerDatabase <Int32>]
 [-AutoDagDatabaseCopiesPerVolume <Int32>]
 [-AutoDagDatabasesRootFolderPath <NonRootLocalLongFullPath>]
 [-AutoDagDiskReclaimerEnabled <Boolean>]
 [-AutoDagTotalNumberOfDatabases <Int32>]
 [-AutoDagTotalNumberOfServers <Int32>]
 [-AutoDagVolumesRootFolderPath <NonRootLocalLongFullPath>]
 [-Confirm]
 [-DagConfiguration <DatabaseAvailabilityGroupConfigurationIdParameter>]
 [-DatabaseAvailabilityGroupIpAddresses <IPAddress[]>]
 [-DatacenterActivationMode <DatacenterActivationModeOption>]
 [-DiscoverNetworks]
 [-DomainController <Fqdn>]
 [-FileSystem <FileSystemMode>]
 [-ManualDagNetworkConfiguration <Boolean>]
 [-MetaCacheDatabaseVolumesPerServer <Int32>]
 [-NetworkCompression <NetworkOption>]
 [-NetworkEncryption <NetworkOption>]
 [-PreferenceMoveFrequency <TimeSpan>]
 [-ReplayLagManagerEnabled <Boolean>]
 [-ReplicationPort <UInt16>]
 [-SkipDagValidation]
 [-WhatIf]
 [-WitnessDirectory <NonRootLocalLongFullPath>]
 [-WitnessServer <FileShareWitnessServerName>]
 [<CommonParameters>]

Parameters (34)

ParameterTypeRequiredWhat it controls
-Identity DatabaseAvailabilityGroupIdParameter yes The Identity parameter specifies the name of the DAG that you want to modify.
-ActivityState ActivityStateOption This parameter is reserved for internal Microsoft use.
-AllowCrossSiteRpcClientAccess SwitchParameter This parameter is reserved for internal Microsoft use.
-AlternateWitnessDirectory NonRootLocalLongFullPath The AlternateWitnessDirectory parameter specifies the name of an alternate directory that's used to store file share witness data. The specified directory must not be in use by any other DAGs or used for any other...
-AlternateWitnessServer FileShareWitnessServerName The AlternateWitnessServer parameter specifies the name of an alternate server that's used to store file share witness data. The specified server must not be a member of the DAG that's configured to use it. This...
-AutoDagAllServersInstalled Boolean This parameter is reserved for internal Microsoft use.
-AutoDagAutoRedistributeEnabled Boolean The AutoDagAutoRedistributeEnabled parameter specifies whether automatic DAG redistribution is enabled or disabled during AutoReseed. The default value is $true (enabled).
-AutoDagAutoReseedEnabled Boolean The AutoDagAutoReseedEnabled is used to enable or disable Autoreseed. The default value is $true (enabled).
-AutoDagBitlockerEnabled Boolean The AutoDagBitlockerEnabled parameter ensures that Disk Reclaimer handles spare disks correctly and encrypts them with BitLocker. If Bitlocker is used to encrypt database disks, set the value of this parameter to...
-AutoDagDatabaseCopiesPerDatabase Int32 This parameter is reserved for internal Microsoft use.
-AutoDagDatabaseCopiesPerVolume Int32 The AutoDagDatabaseCopiesPerVolume parameter is used to specify the configured number of database copies per volume. This parameter is used only with AutoReseed.
-AutoDagDatabasesRootFolderPath NonRootLocalLongFullPath The AutoDagDatabasesRootFolderPath parameter specifies the directory containing the database mount points when using AutoReseed. This parameter is required when using AutoReseed. AutoReseed uses a default path of...
-AutoDagDiskReclaimerEnabled Boolean The AutoDagDiskReclaimerEnabled is used to enable or disable the volume formatting functions used by Autoreseed. The default value is $true (enabled). If you set this to $false, you need to manually format the volume...
-AutoDagTotalNumberOfDatabases Int32 This parameter is reserved for internal Microsoft use.
-AutoDagTotalNumberOfServers Int32 This parameter is reserved for internal Microsoft use.
-AutoDagVolumesRootFolderPath NonRootLocalLongFullPath The AutoDagVolumesRootFolderPath parameter specifies the volume containing the mount points for all disks, including spare disks, when using the AutoReseed feature of the DAG. This parameter is required when using...
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DagConfiguration DatabaseAvailabilityGroupConfigurationIdParameter This parameter is reserved for internal Microsoft use.
-DatabaseAvailabilityGroupIpAddresses IPAddress[] The DatabaseAvailabilityGroupIpAddresses parameter specifies 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...
-DatacenterActivationMode DatacenterActivationModeOption The DatacenterActivationMode parameter specifies the datacenter activation mode for the DAG. Valid values are:
-DiscoverNetworks SwitchParameter The DiscoverNetworks switch specifies whether to force a rediscovery of the network and network interfaces. You don't need to specify a value with this switch.
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-FileSystem FileSystemMode The FileSystem parameter specifies the file system that's used for the DAG. Valid values are:
-ManualDagNetworkConfiguration Boolean The ManualDagNetworkConfiguration parameter specifies whether DAG networks should be automatically configured. If this parameter is set to $false, DAG networks are automatically configured. If this parameter is set...
-MetaCacheDatabaseVolumesPerServer Int32 This parameter is reserved for internal Microsoft use.
-NetworkCompression NetworkOption The NetworkCompression parameter specifies the network compression option for the DAG. Valid values are:
-NetworkEncryption NetworkOption The NetworkEncryption parameter specifies the network encryption option for the DAG. Valid values are:
-PreferenceMoveFrequency TimeSpan The PreferenceMoveFrequency parameter specifies how frequently the Microsoft Exchange Replication service inspects and automatically rebalances the database copies. If the most preferred database copy...
-ReplayLagManagerEnabled Boolean The ReplayLagManagerEnabled parameter specifies whether to disable the automatic playdown of log files for a lagged database copy.
-ReplicationPort UInt16 The ReplicationPort parameter specifies a Transmission Control Protocol (TCP) port for replication (log shipping and seeding) activity. If this parameter isn't specified, the default port for replication is TCP 64327.
-SkipDagValidation SwitchParameter The SkipDagValidation switch specifies whether to bypass the validation of the DAG's quorum model and the health check on the DAG's witness when configuring the DAG. You don't need to specify a value with this switch.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.
-WitnessDirectory NonRootLocalLongFullPath The WitnessDirectory parameter specifies the name of the directory on the server that's used to store file share witness data. The specified directory must not be in use by any other DAGs.
-WitnessServer FileShareWitnessServerName The WitnessServer parameter specifies the name of a server that acts as a witness for the DAG. The server specified can't be a member of the DAG.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.