Hi @Checior200
Thank you for posting your question in Microsoft Q&A.
We understand that your Exchange Server databases are not automatically returning to their primary server (ActivationPreference 1) after exiting maintenance mode. From your description, it appears that after exiting maintenance mode (using StopDagServerMaintenance.ps1), the databases remain active on the secondary server instead of moving back to the primary server as per their ActivationPreference settings, despite the PreferenceMoveFrequency being set to the default 1-hour interval (01:00:00). This behavior suggests that the automatic rebalancing mechanism may not be triggering as expected.
As my research this could be caused by:
Rebalance Timing The automatic rebalance process runs on an hourly schedule. If maintenance mode was exited recently, the system may not have reached the next rebalance window yet.
Server Health Evaluation Active Manager may not consider the primary server healthy enough to host active database copies. This can prevent rebalancing even if the server appears operational.
Replication Service Refresh The Microsoft Exchange Replication service may require a restart to properly apply the rebalancing logic. Without this refresh, the system might not initiate the expected moves.
DAG Configuration Issues Misconfigurations or transient quorum issues, especially in IP-less DAG setups using Datacenter Activation Coordination (DAC) mode, can interfere with rebalancing operations and Active Manager decisions.
Could you try to follow these steps to address this issue:
Verify DAG Configuration
Run:
Get-DatabaseAvailabilityGroup | FL Name, PreferenceMoveFrequency, DatacenterActivationMode
Ensure PreferenceMoveFrequency is set to 01:00:00 and DatacenterActivationMode is DagOnly. If not, update with this command:
Set-DatabaseAvailabilityGroup -Identity "YourDAGName" -PreferenceMoveFrequency 01:00:00
Check your Server Health:
Run:
Get-ServerHealth -Identity "MainServerName" | FL ServerRole, HealthSet, AlertMask
Run this on all DAG members. AlertMask should be 0 (healthy). If issues still persists, you could use this:
Set-ServerComponentState -Identity "MainServerName" -Component ServerWideOffline -State Active -Requester Maintenance
Inspect Database Copy Status
Get-MailboxDatabaseCopyStatus -Identity "YourDBName" | FL Status, ActivationPreferenceRank, ActiveOnServer
Confirm the database is Mounted, check the active server, and look for replication lag or issues.
Review Event Logs
Open Event Viewer and navigate to: Applications and Services Logs -> Microsoft -> Exchange -> High Availability -> Operational
Look for:
Event ID 11322: Rebalance attempts.
Event ID 5000: Active Manager decisions.
Additionally, could you try to verify Activation Preference configuration. To ensure databases are correctly prioritized for activation, review the current activation preference settings:
Get-MailboxDatabase "DB1" | Format-Table Server, DatabaseCopies, ActivationPreference
Confirm that the primary server is assigned ActivationPreference 1.
If the order is incorrect, you can update it using:
Set-MailboxDatabaseCopy -Identity "DB1\Your Primary Server" -ActivationPreference 1
Please understand that our initial reply may not always immediately resolve the issue. However, with your help and more detailed information, we can work together to find a solution.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.