Motivation: Making the Systems Engineers life easier.

Turning Exchange 2013/2016/2019 Out Of Maintenance Mode

Microsoft Exchange

Turning Exchange 2013/2016/2019 Out Of Maintenance Mode

This process has been applied successfully in an Exchange 2016 production environment.

Below is the process to take out the Exchange Server from the Maintenance Mode.

  1. Run the below command to take out the Exchange Server from the Maintenance Mode

[PS] C:\>Set-ServerComponentState “EXCH002” -Component ServerWideOffline -State Active -Requester Maintenance

 

  1. Resume the Cluster Node

[PS] C:\>Resume-ClusterNode -Name “EXCH002”

 

Name         ID    State

—-               —    —–

EXCH002        1     Up

 

  1. Run the DatabaseCopyAutoActivationPolicy

[PS] C:\>Set-MailboxServer “EXCH002” -DatabaseCopyAutoActivationPolicy Unrestricted

 

  1. Run the DatabaseCopyActivationDisabledAndMoveNow command to activate the Database Replication for the node.

[PS] C:\>Set-MailboxServer “EXCH002” -DatabaseCopyActivationDisabledAndMoveNow $false

 

  1. Allow the HubTransport role to accept messages.

[PS] C:\>Set-ServerComponentState “EXCH002” -Component HubTransport -State Active -Requester Maintenance

 

  1. Run the command to verify that the node is UP.

 

[PS] C:\>Get-ClusterNode “EXCH002”

 

  1. Run the below command to verify all the nodes are up in the cluster.

[PS] C:\>Get-ClusterNode

 

  1. Test the health status of the Exchange Server Node

[PS] C:\>Test-ServiceHealth “EXCH002”

Role                    : Mailbox Server Role

RequiredServicesRunning : True

ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeDelivery, MSExchangeIS, MSExchangeMailboxAssistants, MSExchangeRepl, MSExchangeRPC, MSExchangeServiceHost,

MSExchangeSubmission, MSExchangeThrottling, MSExchangeTransportLogSearch, W3Svc, WinRM}

ServicesNotRunning      : {}

 

Role                    : Client Access Server Role

RequiredServicesRunning : True

ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeMailboxReplication, MSExchangeRPC, MSExchangeServiceHost, W3Svc, WinRM}

ServicesNotRunning      : {}

 

Role                    : Unified Messaging Server Role

RequiredServicesRunning : True

ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeServiceHost, MSExchangeUM, W3Svc, WinRM}

ServicesNotRunning      : {}

 

Role                    : Hub Transport Server Role

RequiredServicesRunning : True

ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeEdgeSync, MSExchangeServiceHost, MSExchangeTransport, MSExchangeTransportLogSearch, W3Svc, WinRM}

ServicesNotRunning      : {}

 

  1. Test the health status of all the Exchange Server in the DAG.

[PS] C:\>Get-ExchangeServer | Test-ServiceHealth

 

  1. Test the MAPI connectivity on the node, which is upgraded.

[PS] C:\>Test-MAPIConnectivity -Server “EXCH002”

 

MailboxServer      Database           Result    Error

————-      ——–           ——    —–

EXCH002               DB1                Success

EXCH002               DB2                Success

EXCH002               DB3                Success

EXCH002               DB4                Success

EXCH002               DB5                Success

 

  1. Test the MAPI connectivity on all the Exchange nodes.

[PS] C:\>Get-ExchangeServer | Test-MAPIConnectivity

  1. Check the database copy status on the upgraded node.

 

[PS] C:\>Get-MailboxDatabaseCopyStatus -Server “EXCH002” | Sort Name | Select Name, Status, Contentindexstate

 

Name      Status  ContentIndexState

—-      ——  —————–

DB1\EXCH002 Mounted            Healthy

DB2\EX02 Mounted            Healthy

DB3\EXCH002 Mounted            Healthy

DB4\EX02 Mounted            Healthy

DB5\EXCH002 Mounted            Healthy

 

  1. Check the database copy status on all the Exchange Nodes

[PS] C:\>Get-MailboxDatabaseCopyStatus * | Sort Name | Select Name, Status, Contentindexstate

 

  1. Test the Replication Health Status

[PS] C:\>Get-DatabaseAvailabilityGroup | Select -ExpandProperty:Servers | Test-ReplicationHealth | Sort Name

 

  1. Verify the DatabaseCopyAutoActivationPolicy is Unrestricted on the upgraded node.

[PS] C:\>Get-MailboxServer “EXCH002” | Select Name, DatabaseCopyAutoActivationPolicy

 

Name         DatabaseCopyAutoActivationPolicy

—-         ——————————–

EXCH002                             Unrestricted

 

  1. Verify the DatabaseCopyAutoActivationPolicy is Unrestricted on all the Exchange nodes.

[PS] C:\>Get-MailboxServer | Select Name, DatabaseCopyAutoActivationPolicy

 

  1. Rebalance Database distribution across the DAG Members

[PS] C:\Windows\system32>cd $exscripts

[PS] C:\Program Files\Microsoft\Exchange Server\V15\scripts>.\RedistributeActiveDatabases.ps1 –DagName “DAG001” –Balance DbsByActivationPreference -SkipMoveSuppressionChecks

Comments (2)

  1. Aziz

    Very useful information
    Thank you Mr. Ammar

    March 10, 2021 at 8:55 am
    |Reply
    1. You’re welcome Aziz 🙂

      March 10, 2021 at 8:56 am
      |Reply

Leave your thought here

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Topics