Commands › Exchange Online

Restore-DatabaseAvailabilityGroup

Exchange Online ExchangeOnlineManagement Restore-*

Use the Restore-DatabaseAvailabilityGroup cmdlet as part of a datacenter switchover of a database availability group (DAG).

Quick start script

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

# 2. Run and inspect
Restore-DatabaseAvailabilityGroup -Identity <DatabaseAvailabilityGroupIdParameter> | Format-List

# 3. Export for evidence / drift tracking
Restore-DatabaseAvailabilityGroup | Export-Clixml .\DatabaseAvailabilityGroup-$(Get-Date -Format yyyyMMdd).xml

Syntax

Restore-DatabaseAvailabilityGroup [-Identity] <DatabaseAvailabilityGroupIdParameter>
 [-ActiveDirectorySite <AdSiteIdParameter>]
 [-AlternateWitnessDirectory <NonRootLocalLongFullPath>]
 [-AlternateWitnessServer <FileShareWitnessServerName>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-UsePrimaryWitnessServer]
 [-WhatIf]
 [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-Identity DatabaseAvailabilityGroupIdParameter yes The Identity parameter specifies the name of the DAG being manipulated.
-ActiveDirectorySite AdSiteIdParameter The ActiveDirectorySite parameter specifies the site containing the DAG members to be restored.
-AlternateWitnessDirectory NonRootLocalLongFullPath The AlternateWitnessDirectory parameter specifies the name of an alternate directory used to store witness data. The specified directory must not be in use by any other DAGs or used for any other purpose. This value...
-AlternateWitnessServer FileShareWitnessServerName The AlternateWitnessServer parameter specifies the name of a new witness server for the DAG as part of a site activation process. This value can be populated ahead by using the Set-DatabaseAvailabilityGroup cmdlet.
-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.
-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...
-UsePrimaryWitnessServer SwitchParameter The UsePrimaryWitnessServer switch specifies that the DAG's currently configured witness server should be used if a witness is needed by the DAG members that are being activated. You don't need to specify a value...
-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.

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