Exchange Server out of maintenance mode

 

Exchange Server out of maintenance mode

After the update, we would like to get the Exchange Server EX01 active again. So, let’s remove the server from maintenance mode.

Run Exchange Management Shell as administrator and run the commands.

Note: Only the first and last commands are necessary if the server is not a DAG member. If the server is a DAG member, you need to run all the commands.

Use the database copy auto-activation policy value that was set on the server. The default is Unrestricted.

[PS] C:\>Set-ServerComponentState "EX01" -Component ServerWideOffline -State Active -Requester Maintenance

[PS] C:\>Resume-ClusterNode -Name "EX01"

[PS] C:\>Set-MailboxServer "EX01" -DatabaseCopyAutoActivationPolicy Unrestricted

[PS] C:\>Set-MailboxServer "EX01" -DatabaseCopyActivationDisabledAndMoveNow $false

[PS] C:\>Set-ServerComponentState "EX01" -Component HubTransport -State Active -Requester Maintenance

Rebalance Database Availability Groups

Throughout the update process, the database copies will move between DAG members. Return your active database copies to their most preferred DAG member. 

[PS] C:\>cd $exscripts
 
[PS] C:\Program Files\Microsoft\Exchange Server\V15\scripts\>.\RedistributeActiveDatabases.ps1 -DagName "DAG1" -BalanceDbsByActivationPreference -SkipMoveSuppressionChecks

Verify out of maintenance mode

Verify if the Exchange Server EX01 is back up and running. Run the following commands.

The cluster node needs to have the state up.

[PS] C:\>Get-ClusterNode "EX01"

Name         ID    State
----         --    -----
EX01         1     Up

Check that the cluster node has the state up on all the Exchange Servers.

[PS] C:\>Get-ClusterNode

Check that all the required services are running.

[PS] C:\>Test-ServiceHealth "EX01"


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      : {}

Check that the required services are running on all the Exchange Servers.

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

Test the MAPI Connectivity

[PS] C:\>Test-MAPIConnectivity -Server "EX01"

MailboxServer      Database           Result    Error
-------------      --------           ------    -----
EX01               DB1                Success
EX01               DB2                Success
EX01               DB3                Success
EX01               DB4                Success
EX01               DB5                Success

Test the MAPI Connectivity on all the Exchange Servers.

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

Get the result of the DAG Copy Status Health.

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

Name      Status  ContentIndexState
----      ------  -----------------
DB1\EX01 Mounted            Healthy
DB2\EX02 Mounted            Healthy
DB3\EX01 Mounted            Healthy
DB4\EX02 Mounted            Healthy
DB5\EX01 Mounted            Healthy
 result of the DAG Copy Status Health on all the Exchange Servers.
[PS] C:\>Get-MailboxDatabaseCopyStatus * | Sort Name | Select Name, Status, Contentindexstate

Check the Replication Health.

[PS] C:\>Test-ReplicationHealth -Server "EX01"

Server     Check                      Result     Error
------     -----                      ------     -----
EX01       ClusterService             Passed
EX01       ReplayService              Passed
EX01       ActiveManager              Passed
EX01       TasksRpcListener           Passed
EX01       TcpListener                Passed
EX01       ServerLocatorService       Passed
EX01       DagMembersUp               Passed
EX01       MonitoringService          Passed
EX01       ClusterNetwork             Passed
EX01       QuorumGroup                Passed
EX01       FileShareQuorum            Passed
EX01       DatabaseRedundancy         Passed
EX01       DatabaseAvailability       Passed
EX01       DBCopySuspended            Passed
EX01       DBCopyFailed               Passed
EX01       DBInitializing             Passed
EX01       DBDisconnected             Passed
EX01       DBLogCopyKeepingUp         Passed
EX01       DBLogReplayKeepingUp       Passed

Check the Replication Health on all the Exchange Servers.

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

Verify the Database Activation Policy is set to Unrestricted.

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

Name         DatabaseCopyAutoActivationPolicy
----         --------------------------------
EX01                             Unrestricted

Verify the Database Activation Policy is set to Unrestricted on all the Exchange Servers.

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


 It’s important to run the commands and check if all the services are healthy. It’s good to have a list of PowerShell commands before starting. The output needs to be positive.

No comments: