• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
OpenTechTips

OpenTechTips

Comprehensive IT Guides for Pros and Enthusiasts

MENUMENU
  • HOME
  • ALL TOPICS
    • Exchange
    • InfoSec
    • Linux
    • Networking
    • Scripting
      • PowerShell
    • SSL
    • Tools
    • Virtualization
    • Web
    • Windows
  • ABOUT
  • SUBSCRIBE
Home » Exchange DAG failover procedure with a Real Life Example

Exchange DAG failover procedure with a Real Life Example

May 11, 2020 - by Zsolt Agoston - last edited on May 11, 2020

From time to time performing maintenance on a DAG member server might be necessary. For example, cumulative updates for Exchange are released quarterly, installing them requires stopping services and rebooting the server. During the process we want the mail flow, database access and client access uninterrupted. In a failover situation (where the active database server disappears) the DAG will take care of the switch-over but in a planned situation we better do the process gracefully, leaving time for the services to accommodate, mail queues to drain on the soon-to-be-rebooted server, etc.

Here are the steps to perform the failover and to reinstate the server after the procedure.

Before you Begin

Check the health of the mailbox databases, make sure the passive copies that are going to be activated are in a healthy state.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
PS C:\> Get-MailboxServer | %{Get-MailboxDatabaseCopyStatus -Server $_.name} | ft -AutoSize
Name Status CopyQueueLength ReplayQueueLength LastInspectedLogTime ContentIndexState
---- ------ --------------- ----------------- -------------------- -----------------
DB01\MAIL Mounted 0 0 NotApplicable
DB02\MAIL Mounted 0 0 NotApplicable
DB-test\MAIL Mounted 0 0 NotApplicable
DB02\MAIL2 Healthy 0 0 10/05/2020 13:50:41 NotApplicable
DB01\MAIL2 Healthy 0 0 10/05/2020 13:48:13 NotApplicable
PS C:\> Get-MailboxServer | %{Get-MailboxDatabaseCopyStatus -Server $_.name} | ft -AutoSize Name Status CopyQueueLength ReplayQueueLength LastInspectedLogTime ContentIndexState ---- ------ --------------- ----------------- -------------------- ----------------- DB01\MAIL Mounted 0 0 NotApplicable DB02\MAIL Mounted 0 0 NotApplicable DB-test\MAIL Mounted 0 0 NotApplicable DB02\MAIL2 Healthy 0 0 10/05/2020 13:50:41 NotApplicable DB01\MAIL2 Healthy 0 0 10/05/2020 13:48:13 NotApplicable
PS C:\> Get-MailboxServer | %{Get-MailboxDatabaseCopyStatus -Server $_.name} | ft -AutoSize

Name         Status  CopyQueueLength ReplayQueueLength LastInspectedLogTime ContentIndexState
----         ------  --------------- ----------------- -------------------- -----------------
DB01\MAIL    Mounted 0               0                                      NotApplicable
DB02\MAIL    Mounted 0               0                                      NotApplicable
DB-test\MAIL Mounted 0               0                                      NotApplicable
DB02\MAIL2   Healthy 0               0                 10/05/2020 13:50:41  NotApplicable
DB01\MAIL2   Healthy 0               0                 10/05/2020 13:48:13  NotApplicable

We see that both DB01 and DB02 databases are active on the server called MAIL. We put MAIL in maintenance mode, minimizing user distraction during the process.

Put the server in Maintenance mode

We deactivate all the mentioned services from MAIL.alwayshotcafe.com, leaving MAIL2.alwayshotcafe.com as the active member to serve clients and ensure continuous mail flow.

Before maintenance mode, DB01 is active on MAIL, while DB02 is active on MAIL2 as seen below:

Exchange DAG failover procedure with a Real Life Example

START:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Redirect SMTP traffic away from the server
PS C:\> Set-ServerComponentState MAIL -Component HubTransport -State Draining -Requester Maintenance
PS C:\> Redirect-Message -Server MAIL -Target MAIL2.alwayshotcafe.com
# Redirect SMTP traffic away from the server PS C:\> Set-ServerComponentState MAIL -Component HubTransport -State Draining -Requester Maintenance PS C:\> Redirect-Message -Server MAIL -Target MAIL2.alwayshotcafe.com
# Redirect SMTP traffic away from the server
PS C:\> Set-ServerComponentState MAIL -Component HubTransport -State Draining -Requester Maintenance
PS C:\> Redirect-Message -Server MAIL -Target MAIL2.alwayshotcafe.com

Note: always use the FQDN of the target server in the Redirect-Message cmdlet!

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Suspend the failover cluster node (to be run on MAIL itself!)
PS C:\> Suspend-ClusterNode -Name MAIL
# Suspend the failover cluster node (to be run on MAIL itself!) PS C:\> Suspend-ClusterNode -Name MAIL
# Suspend the failover cluster node (to be run on MAIL itself!)
PS C:\> Suspend-ClusterNode -Name MAIL
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Disable the auto-activation of mailboxes on the server and put it in maintenance mode
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyActivationDisabledAndMoveNow:$true
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyAutoActivationPolicy Blocked
# Disable the auto-activation of mailboxes on the server and put it in maintenance mode PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyActivationDisabledAndMoveNow:$true PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyAutoActivationPolicy Blocked
# Disable the auto-activation of mailboxes on the server and put it in maintenance mode
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyActivationDisabledAndMoveNow:$true
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyAutoActivationPolicy Blocked
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
PS C:\> Set-ServerComponentState MAIL -Component ServerWideOffline -State Inactive -Requester Maintenance
PS C:\> Set-ServerComponentState MAIL -Component ServerWideOffline -State Inactive -Requester Maintenance
PS C:\> Set-ServerComponentState MAIL -Component ServerWideOffline -State Inactive -Requester Maintenance

BE PATIENT: After running the script please WAIT until the services are switching over to the active server! It might take long minutes for the database copies to activate on the other server, and half an hour or longer for Outlook clients to switch to the active instance!

Exchange DAG failover procedure with a Real Life Example

2. Reinstate MAIL server (remove it from maintenance mode)

When you are done updating, rebooting the server, take it out from maintenance mode:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
PS C:\> Set-ServerComponentState MAIL -Component ServerWideOffline -State Active -Requester Maintenance
PS C:\> Set-ServerComponentState MAIL -Component ServerWideOffline -State Active -Requester Maintenance
PS C:\> Set-ServerComponentState MAIL -Component ServerWideOffline -State Active -Requester Maintenance
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Resume the failover cluster node (to be run on MAIL itself!)
PS C:\> Resume-ClusterNode -Name MAIL
# Resume the failover cluster node (to be run on MAIL itself!) PS C:\> Resume-ClusterNode -Name MAIL
# Resume the failover cluster node (to be run on MAIL itself!)
PS C:\> Resume-ClusterNode -Name MAIL
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Enable the auto-activation of mailboxes on the server and put it in maintenance mode
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyAutoActivationPolicy Unrestricted
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyActivationDisabledAndMoveNow:$false
# Enable the auto-activation of mailboxes on the server and put it in maintenance mode PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyAutoActivationPolicy Unrestricted PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyActivationDisabledAndMoveNow:$false
# Enable the auto-activation of mailboxes on the server and put it in maintenance mode
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyAutoActivationPolicy Unrestricted
PS C:\> Set-MailboxServer -Identity MAIL -DatabaseCopyActivationDisabledAndMoveNow:$false
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Redirect SMTP traffic away from the server
PS C:\> Set-ServerComponentState MAIL -Component HubTransport -State Active -Requester Maintenance
# Redirect SMTP traffic away from the server PS C:\> Set-ServerComponentState MAIL -Component HubTransport -State Active -Requester Maintenance
# Redirect SMTP traffic away from the server
PS C:\> Set-ServerComponentState MAIL -Component HubTransport -State Active -Requester Maintenance

Monitor Server Status

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Check the database copy status on all servers:
PS C:\> Get-MailboxServer | %{Get-MailboxDatabaseCopyStatus -Server $_.name | ft -AutoSize}
# Check the database copy status on all servers: PS C:\> Get-MailboxServer | %{Get-MailboxDatabaseCopyStatus -Server $_.name | ft -AutoSize}
# Check the database copy status on all servers:
PS C:\> Get-MailboxServer | %{Get-MailboxDatabaseCopyStatus -Server $_.name | ft -AutoSize}
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Check server components if they are active or inactive:
PS C:\ > Get-ServerComponentState -Identity MAIL
Server Component State
------ --------- -----
MAIL.AlwaysHotCafe.com ServerWideOffline Active
MAIL.AlwaysHotCafe.com HubTransport Active
MAIL.AlwaysHotCafe.com FrontendTransport Active
MAIL.AlwaysHotCafe.com Monitoring Active
MAIL.AlwaysHotCafe.com RecoveryActionsEnabled Active
MAIL.AlwaysHotCafe.com AutoDiscoverProxy Active
MAIL.AlwaysHotCafe.com ActiveSyncProxy Active
MAIL.AlwaysHotCafe.com EcpProxy Active
MAIL.AlwaysHotCafe.com EwsProxy Active
MAIL.AlwaysHotCafe.com ImapProxy Active
MAIL.AlwaysHotCafe.com OabProxy Active
MAIL.AlwaysHotCafe.com OwaProxy Active
MAIL.AlwaysHotCafe.com PopProxy Active
MAIL.AlwaysHotCafe.com PushNotificationsProxy Active
MAIL.AlwaysHotCafe.com RpsProxy Active
MAIL.AlwaysHotCafe.com RwsProxy Active
MAIL.AlwaysHotCafe.com RpcProxy Active
MAIL.AlwaysHotCafe.com XropProxy Active
MAIL.AlwaysHotCafe.com HttpProxyAvailabilityGroup Active
MAIL.AlwaysHotCafe.com ForwardSyncDaemon Inactive
MAIL.AlwaysHotCafe.com ProvisioningRps Inactive
MAIL.AlwaysHotCafe.com MapiProxy Active
MAIL.AlwaysHotCafe.com EdgeTransport Active
MAIL.AlwaysHotCafe.com HighAvailability Active
MAIL.AlwaysHotCafe.com SharedCache Active
MAIL.AlwaysHotCafe.com MailboxDeliveryProxy Active
MAIL.AlwaysHotCafe.com RoutingUpdates Active
MAIL.AlwaysHotCafe.com RestProxy Active
MAIL.AlwaysHotCafe.com DefaultProxy Active
MAIL.AlwaysHotCafe.com Lsass Active
MAIL.AlwaysHotCafe.com RoutingService Active
MAIL.AlwaysHotCafe.com E4EProxy Active
MAIL.AlwaysHotCafe.com CafeLAMv2 Active
MAIL.AlwaysHotCafe.com LogExportProvider Active
# Check server components if they are active or inactive: PS C:\ > Get-ServerComponentState -Identity MAIL Server Component State ------ --------- ----- MAIL.AlwaysHotCafe.com ServerWideOffline Active MAIL.AlwaysHotCafe.com HubTransport Active MAIL.AlwaysHotCafe.com FrontendTransport Active MAIL.AlwaysHotCafe.com Monitoring Active MAIL.AlwaysHotCafe.com RecoveryActionsEnabled Active MAIL.AlwaysHotCafe.com AutoDiscoverProxy Active MAIL.AlwaysHotCafe.com ActiveSyncProxy Active MAIL.AlwaysHotCafe.com EcpProxy Active MAIL.AlwaysHotCafe.com EwsProxy Active MAIL.AlwaysHotCafe.com ImapProxy Active MAIL.AlwaysHotCafe.com OabProxy Active MAIL.AlwaysHotCafe.com OwaProxy Active MAIL.AlwaysHotCafe.com PopProxy Active MAIL.AlwaysHotCafe.com PushNotificationsProxy Active MAIL.AlwaysHotCafe.com RpsProxy Active MAIL.AlwaysHotCafe.com RwsProxy Active MAIL.AlwaysHotCafe.com RpcProxy Active MAIL.AlwaysHotCafe.com XropProxy Active MAIL.AlwaysHotCafe.com HttpProxyAvailabilityGroup Active MAIL.AlwaysHotCafe.com ForwardSyncDaemon Inactive MAIL.AlwaysHotCafe.com ProvisioningRps Inactive MAIL.AlwaysHotCafe.com MapiProxy Active MAIL.AlwaysHotCafe.com EdgeTransport Active MAIL.AlwaysHotCafe.com HighAvailability Active MAIL.AlwaysHotCafe.com SharedCache Active MAIL.AlwaysHotCafe.com MailboxDeliveryProxy Active MAIL.AlwaysHotCafe.com RoutingUpdates Active MAIL.AlwaysHotCafe.com RestProxy Active MAIL.AlwaysHotCafe.com DefaultProxy Active MAIL.AlwaysHotCafe.com Lsass Active MAIL.AlwaysHotCafe.com RoutingService Active MAIL.AlwaysHotCafe.com E4EProxy Active MAIL.AlwaysHotCafe.com CafeLAMv2 Active MAIL.AlwaysHotCafe.com LogExportProvider Active
# Check server components if they are active or inactive:
PS C:\ > Get-ServerComponentState -Identity MAIL

Server                 Component                  State
------                 ---------                  -----
MAIL.AlwaysHotCafe.com ServerWideOffline          Active
MAIL.AlwaysHotCafe.com HubTransport               Active
MAIL.AlwaysHotCafe.com FrontendTransport          Active
MAIL.AlwaysHotCafe.com Monitoring                 Active
MAIL.AlwaysHotCafe.com RecoveryActionsEnabled     Active
MAIL.AlwaysHotCafe.com AutoDiscoverProxy          Active
MAIL.AlwaysHotCafe.com ActiveSyncProxy            Active
MAIL.AlwaysHotCafe.com EcpProxy                   Active
MAIL.AlwaysHotCafe.com EwsProxy                   Active
MAIL.AlwaysHotCafe.com ImapProxy                  Active
MAIL.AlwaysHotCafe.com OabProxy                   Active
MAIL.AlwaysHotCafe.com OwaProxy                   Active
MAIL.AlwaysHotCafe.com PopProxy                   Active
MAIL.AlwaysHotCafe.com PushNotificationsProxy     Active
MAIL.AlwaysHotCafe.com RpsProxy                   Active
MAIL.AlwaysHotCafe.com RwsProxy                   Active
MAIL.AlwaysHotCafe.com RpcProxy                   Active
MAIL.AlwaysHotCafe.com XropProxy                  Active
MAIL.AlwaysHotCafe.com HttpProxyAvailabilityGroup Active
MAIL.AlwaysHotCafe.com ForwardSyncDaemon          Inactive
MAIL.AlwaysHotCafe.com ProvisioningRps            Inactive
MAIL.AlwaysHotCafe.com MapiProxy                  Active
MAIL.AlwaysHotCafe.com EdgeTransport              Active
MAIL.AlwaysHotCafe.com HighAvailability           Active
MAIL.AlwaysHotCafe.com SharedCache                Active
MAIL.AlwaysHotCafe.com MailboxDeliveryProxy       Active
MAIL.AlwaysHotCafe.com RoutingUpdates             Active
MAIL.AlwaysHotCafe.com RestProxy                  Active
MAIL.AlwaysHotCafe.com DefaultProxy               Active
MAIL.AlwaysHotCafe.com Lsass                      Active
MAIL.AlwaysHotCafe.com RoutingService             Active
MAIL.AlwaysHotCafe.com E4EProxy                   Active
MAIL.AlwaysHotCafe.com CafeLAMv2                  Active
MAIL.AlwaysHotCafe.com LogExportProvider          Active

Reader Interactions

Comments Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Tools

Secondary Sidebar

CONTENTS

  • Before you Begin
  • Put the server in Maintenance mode
  • 2. Reinstate MAIL server (remove it from maintenance mode)
  • Monitor Server Status

  • Terms of Use
  • Disclaimer
  • Privacy Policy
Manage your privacy

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
Manage your privacy
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}