Commands › Exchange Online

Set-MailboxDatabase

Exchange Online ExchangeOnlineManagement Set-*

Configure a variety of properties for a mailbox database.

Quick start script

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

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

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

Syntax

Set-MailboxDatabase [-Identity] <DatabaseIdParameter>
 [-AllowFileRestore <Boolean>]
 [-AutoDagExcludeFromMonitoring <Boolean>]
 [-AutoDatabaseMountDial <AutoDatabaseMountDial>]
 [-BackgroundDatabaseMaintenance <Boolean>]
 [-CalendarLoggingQuota <Unlimited>]
 [-CircularLoggingEnabled <Boolean>]
 [-Confirm]
 [-DatabaseGroup <String>]
 [-DataMoveReplicationConstraint <DataMoveReplicationConstraintParameter>]
 [-DeletedItemRetention <EnhancedTimeSpan>]
 [-DomainController <Fqdn>]
 [-EventHistoryRetentionPeriod <EnhancedTimeSpan>]
 [-IndexEnabled <Boolean>]
 [-IsExcludedFromInitialProvisioning <Boolean>]
 [-IsExcludedFromProvisioning <Boolean>]
 [-IsExcludedFromProvisioningByOperator <Boolean>]
 [-IsExcludedFromProvisioningDueToLogicalCorruption <Boolean>]
 [-IsExcludedFromProvisioningReason <String>]
 [-IssueWarningQuota <Unlimited>]
 [-IsSuspendedFromProvisioning <Boolean>]
 [-JournalRecipient <RecipientIdParameter>]
 [-MailboxRetention <EnhancedTimeSpan>]
 [-MaintenanceSchedule <Schedule>]
 [-MetaCacheDatabaseMaxCapacityInBytes <Int64>]
 [-MountAtStartup <Boolean>]
 [-Name <String>]
 [-OfflineAddressBook <OfflineAddressBookIdParameter>]
 [-ProhibitSendQuota <Unlimited>]
 [-ProhibitSendReceiveQuota <Unlimited>]
 [-PublicFolderDatabase <DatabaseIdParameter>]
 [-QuotaNotificationSchedule <Schedule>]
 [-RecoverableItemsQuota <Unlimited>]
 [-RecoverableItemsWarningQuota <Unlimited>]
 [-RetainDeletedItemsUntilBackup <Boolean>]
 [-RpcClientAccessServer <ClientAccessServerOrArrayIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (37)

ParameterTypeRequiredWhat it controls
-Identity DatabaseIdParameter yes The Identity parameter specifies the mailbox database that you want to modify. You can use any value that uniquely identifies the database. For example:
-AllowFileRestore Boolean The AllowFileRestore parameter specifies whether to allow a database to be restored from a backup. Valid values are:
-AutoDagExcludeFromMonitoring Boolean The AutoDagExcludedFromMonitoring parameter specifies whether to exclude the mailbox database from the ServerOneCopyMonitor, which alerts an administrator when a replicated database has only one healthy copy...
-AutoDatabaseMountDial AutoDatabaseMountDial This parameter is reserved for internal Microsoft use.
-BackgroundDatabaseMaintenance Boolean The BackgroundDatabaseMaintenance parameter specifies whether the Extensible Storage Engine (ESE) performs database maintenance. Valid values are:
-CalendarLoggingQuota Unlimited The CalendarLoggingQuota parameter specifies the maximum size of the log in the Recoverable Items folder of the mailbox that stores changes to calendar items. When the log exceeds this size, calendar logging is...
-CircularLoggingEnabled Boolean The CircularLoggingEnabled parameter specifies whether circular logging is enabled for the database. Valid values are:
-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.
-DatabaseGroup String This parameter is reserved for internal Microsoft use.
-DataMoveReplicationConstraint DataMoveReplicationConstraintParameter The DataMoveReplicationConstraint parameter specifies the throttling behavior for high availability mailbox moves. Valid values are:
-DeletedItemRetention EnhancedTimeSpan The DeletedItemRetention parameter specifies the length of time to keep deleted items in the Recoverable Items\\Deletions folder in mailboxes. Items are moved to this folder when the user deletes items from the...
-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...
-EventHistoryRetentionPeriod EnhancedTimeSpan The EventHistoryRetentionPeriod parameter specifies the length of time to keep event data. This event data is stored in the event history table in the Exchange store. It includes information about changes to various...
-IndexEnabled Boolean This parameter is functional only in Exchange 2016 or earlier.
-IsExcludedFromInitialProvisioning Boolean This parameter is reserved for internal Microsoft use.
-IsExcludedFromProvisioning Boolean The IsExcludedFromProvisioning parameter specifies whether to exclude the database from the mailbox provisioning load balancer that distributes new mailboxes randomly and evenly across the available databases. Valid...
-IsExcludedFromProvisioningByOperator Boolean The IIsExcludedFromProvisioningByOperator parameter specifies whether to exclude the database from the mailbox provisioning load balancer that distributes new mailboxes randomly and evenly across the available databases.
-IsExcludedFromProvisioningDueToLogicalCorruption Boolean The IsExcludedFromProvisioningDueToLogicalCorruption parameter specifies whether to exclude the database from the mailbox provisioning load balancer that distributes new mailboxes randomly and evenly across the...
-IsExcludedFromProvisioningReason String The IsExcludedFromProvisioningReason parameter specifies the reason why you excluded the mailbox database from the mailbox provisioning load balancer. If the value contains spaces, enclose the value in quotation...
-IssueWarningQuota Unlimited The IssueWarningQuota parameter specifies the warning threshold for the size of the mailbox. If the mailbox reaches or exceeds this size, the user receives a descriptive warning message.
-IsSuspendedFromProvisioning Boolean The IsSuspendedFromProvisioning parameter specifies whether to exclude the database from the mailbox provisioning load balancer that distributes new mailboxes randomly and evenly across the available databases. Valid...
-JournalRecipient RecipientIdParameter The JournalRecipient parameter specifies the journal recipient to use for per-database journaling for all mailboxes on the database. You can use any value that uniquely identifies the recipient. For example:
-MailboxRetention EnhancedTimeSpan The MailboxRetention parameter specifies the length of time to keep deleted mailboxes before they are permanently deleted or purged.
-MaintenanceSchedule Schedule This parameter is functional only in Exchange Server 2010.
-MetaCacheDatabaseMaxCapacityInBytes Int64 The MetaCacheDatabaseMaxCapacityInBytes parameter specifies the size of the metacache database in bytes. To convert gigabytes to bytes, multiply the value by 1024^3. For terabytes to bytes, multiply by 1024^4.
-MountAtStartup Boolean The MountAtStartup parameter specifies whether to mount the mailbox database when the Microsoft Exchange Information Store service starts. Valid values are:
-Name String The Name parameter specifies the unique name of the mailbox database. The maximum length is 64 characters. If the value contains spaces, enclose the value in quotation marks (").
-OfflineAddressBook OfflineAddressBookIdParameter The OfflineAddressBook parameter specifies the offline address book that's associated with the mailbox database. You can use any value that uniquely identifies the offline address book. For example:
-ProhibitSendQuota Unlimited The ProhibitSendQuota parameter specifies a size limit for the mailbox. If the mailbox reaches or exceeds this size, the mailbox can't send new messages, and the user receives a descriptive warning message.
-ProhibitSendReceiveQuota Unlimited The ProhibitSendReceiveQuota parameter specifies a size limit for the mailbox. If the mailbox reaches or exceeds this size, the mailbox can't send or receive new messages. Messages sent to the mailbox are returned to...
-PublicFolderDatabase DatabaseIdParameter This parameter is functional only in Exchange Server 2010.
-QuotaNotificationSchedule Schedule This parameter is functional only in Exchange Server 2010.
-RecoverableItemsQuota Unlimited The RecoverableItemsQuota parameter specifies the maximum size for the Recoverable Items folder of the mailbox. If the Recoverable Items folder reaches or exceeds this size, it no longer accepts messages.
-RecoverableItemsWarningQuota Unlimited The RecoverableItemsWarningQuota parameter specifies the warning threshold for the size of the Recoverable Items folder for the mailbox. If the Recoverable Items folder reaches or exceeds this size, Exchange logs an...
-RetainDeletedItemsUntilBackup Boolean The RetainDeletedItemsUntilBackup parameter specifies whether to keep items in the Recoverable Items\\Deletions folder of the mailbox until the next database backup occurs. Valid values are:
-RpcClientAccessServer ClientAccessServerOrArrayIdParameter This parameter is functional only in Exchange Server 2010.
-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.