Commands › Exchange Online

New-DatabaseAvailabilityGroup

Exchange Online ExchangeOnlineManagement New-*

Create a database availability group (DAG).

Quick start script

# New-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)
New-DatabaseAvailabilityGroup -Name <String> -WhatIf
New-DatabaseAvailabilityGroup -Name <String>

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

Syntax

New-DatabaseAvailabilityGroup [-Name] <String>
 [-ActivityState <ActivityStateOption>]
 [-Confirm]
 [-DagConfiguration <DatabaseAvailabilityGroupConfigurationIdParameter>]
 [-DatabaseAvailabilityGroupIpAddresses <IPAddress[]>]
 [-DomainController <Fqdn>]
 [-FileSystem <FileSystemMode>]
 [-ThirdPartyReplication <ThirdPartyReplicationMode>]
 [-WhatIf]
 [-WitnessDirectory <NonRootLocalLongFullPath>]
 [-WitnessServer <FileShareWitnessServerName>]
 [<CommonParameters>]

Parameters (11)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies a unique name for the new DAG of up to 15 characters. The name you use must not conflict with any computer name in the organization.
-ActivityState ActivityStateOption This parameter is reserved for internal Microsoft use.
-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 IPv4 addresses to the DAG when a Mailbox server is added to a DAG. If you specify the value Any or 0.0.0.0, the system attempts to lease...
-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:
-ThirdPartyReplication ThirdPartyReplicationMode The ThirdPartyReplication parameter specifies to configure and enable a DAG to use non-Microsoft replication that leverages the Exchange Third Party Replication API instead of the built-in continuous replication....
-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 witness server used to store file share witness data. The directory and share should be hosted on an Exchange server other than any of the...
-WitnessServer FileShareWitnessServerName The WitnessServer parameter specifies the name of a server used as a quorum witness when the DAG contains an even number of members. The specified server can't be a member of the DAG that's configured to use it. A...

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