Commands › Exchange Online

Set-MailboxDatabaseCopy

Exchange Online ExchangeOnlineManagement Set-*

Configure the properties of a database copy.

Quick start script

# Set-MailboxDatabaseCopy — 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-MailboxDatabaseCopy
$before | Format-List

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

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

Syntax

Set-MailboxDatabaseCopy [-Identity] <DatabaseCopyIdParameter>
 [-ActivationPreference <UInt32>]
 [-Confirm]
 [-DatabaseCopyAutoActivationPolicy <DatabaseCopyAutoActivationPolicyType>]
 [-DomainController <Fqdn>]
 [-ReplayLagMaxDelay <EnhancedTimeSpan>]
 [-ReplayLagTime <EnhancedTimeSpan>]
 [-TruncationLagTime <EnhancedTimeSpan>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (9)

ParameterTypeRequiredWhat it controls
-Identity DatabaseCopyIdParameter yes The Identity parameter specifies the name of the database whose copy is being modified.
-ActivationPreference UInt32 The ActivationPreference parameter value is used as part of Active Manager's best copy selection process and to redistribute active mailbox databases throughout the database availability group (DAG) when using the...
-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...
-ReplayLagTime EnhancedTimeSpan The ReplayLagTime parameter specifies the amount of time that the Microsoft Exchange Replication service should wait before replaying log files that have been copied to the passive database copy. Setting this...
-TruncationLagTime EnhancedTimeSpan The TruncationLagTime parameter specifies the amount of time that the Microsoft Exchange Replication service should wait before truncating log files that have replayed into the passive copy of the database. The time...
-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.
-DatabaseCopyAutoActivationPolicy DatabaseCopyAutoActivationPolicyType This parameter is reserved for internal Microsoft use.
-ReplayLagMaxDelay EnhancedTimeSpan The ReplayLagMaxDelay parameter specifies the maximum delay for lagged database copy play down (also known as deferred lagged copy play down). If the disk read IO latency is greater than 25 ms, lagged copy play down...

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