This process has been applied successfully in an Exchange 2016 production environment.
I am having a three (3) node Exchange 2016 in a DAG, for patching Exchange, it is a recommendation to put the Exchange Server into the maintenance mode and then do the patching in order to avoid any Disconnectivity issues from the clients perspective and a seamless upgrade/update. Let’s begin….
This process is for One Server in DAG and applies to all, one by one. Never try to get over smart and put two servers in maintenance mode thinking that Exchange Services will work on One Server. You might end up damaging your environment.
- Drain the HubTransport role in order to stop accepting any more messages.
[PS] C:\>Set-ServerComponentState -Identity “EXCH002” -Component HubTransport -State Draining -Requester Maintenance
Note: If the server is a DAG Member run the following commands, if you have a single Exchange Server then directly run the ServerWideOffline command mentioned in Step 9.
- Redirect all the incoming messages to another available Exchange Node.
[PS] C:\>Redirect-Message -Server “EXCH002” -Target “EXCH001.mgmt.local”
Confirm
Are you sure you want to perform this action?
Redirecting messages to “EXCH001.mgmt.local “.
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”): Y
- Suspend the node from the DAG Cluster
[PS] C:\>Suspend-ClusterNode “EXCH002”
Name ID State
—- — —–
EXCH002 1 Paused
- Stop automatic database activation on the Server,
[PS] C:\>Set-MailboxServer “EXCH002” -DatabaseCopyActivationDisabledAndMoveNow $true
- Makes sure the DatabaseCopyAutoActivationPolicy is set to unrestricted.
[PS] C:\>Get-MailboxServer “EXCH002” | Select DatabaseCopyAutoActivationPolicy
DatabaseCopyAutoActivationPolicy
——————————–
Unrestricted
- Blocking the Database activation as we have planned to put this server into the maintenance mode
[PS] C:\>Set-MailboxServer “EXCH002” -DatabaseCopyAutoActivationPolicy Blocked
- Verify if there are any database mounted on the server and it should be node, if you find it then you manually mount the databases on different node.
[PS] C:\>Get-MailboxDatabaseCopyStatus -Server “EXCH002” | Where {$_.Status -eq “Mounted”}
- Run Get-Queue command to make sure there are ZERO (0) queues
[PS] C:\>Get-Queue
- Run the below command to put the server into the maintenance mode.
[PS] C:\>Set-ServerComponentState “EXCH002” -Component ServerWideOffline -State Inactive -Requester Maintenance
- Run the below command to get the server status.
[PS] C:\>Get-ServerComponentState “EXCH002” | Select Component, State
Component State
——— —–
ServerWideOffline Inactive
HubTransport Inactive
FrontendTransport Inactive
Monitoring Active
RecoveryActionsEnabled Active
AutoDiscoverProxy Inactive
ActiveSyncProxy Inactive
EcpProxy Inactive
EwsProxy Inactive
ImapProxy Inactive
OabProxy Inactive
OwaProxy Inactive
PopProxy Inactive
PushNotificationsProxy Inactive
RpsProxy Inactive
RwsProxy Inactive
RpcProxy Inactive
UMCallRouter Inactive
XropProxy Inactive
HttpProxyAvailabilityGroup Inactive
ForwardSyncDaemon Inactive
ProvisioningRps Inactive
MapiProxy Inactive
EdgeTransport Inactive
HighAvailability Inactive
SharedCache Inactive
MailboxDeliveryProxy Inactive
RoutingUpdates Inactive
RestProxy Inactive
DefaultProxy Inactive
Lsass Inactive
RoutingService Inactive
E4EProxy Inactive
CafeLAMv2 Inactive
LogExportProvider Inactive
Reboot the server once and then start the upgrade process.
check the below link to turn Exchange Out Of Maintenance Mode.
https://ammar.cloud/turning-exchange…maintenance-mode/