Purpose
This article describes how to enable and disable maintenance mode for Exchange mailbox servers that are not members of a Database Availability Group.
Run all commands from the Exchange Management Shell on the mailbox server, and replace <ServerName> with that server's name.
Enable maintenance mode
-
Drain the active mail queues on the mailbox server:
Set-ServerComponentState <ServerName> -Component HubTransport -State Draining -Requester Maintenance -
Force the transport service to pick up the state change:
Restart-Service MSExchangeTransportOn a multi-role server, also run:
Restart-Service MSExchangeFrontEndTransport -
Redirect messages still pending delivery in the local queues to another mailbox server:
Redirect-Message -Server <ServerName> -Target <MailboxServerFQDN>The
-Targetvalue must be the target server's FQDN, and that server must not itself be in maintenance mode. -
Place the server into maintenance mode:
Set-ServerComponentState <ServerName> -Component ServerWideOffline -State Inactive -Requester Maintenance -
Verify:
Get-ServerComponentState <ServerName> | ft Component,State -AutoSizeAll components should show Inactive, except Monitoring and RecoveryActionsEnabled.
Disable maintenance mode
-
Bring the server back online:
Set-ServerComponentState <ServerName> -Component ServerWideOffline -State Active -Requester Maintenance -
Force the transport service to pick up the state change:
Restart-Service MSExchangeTransportOn a multi-role server, also run:
Restart-Service MSExchangeFrontEndTransport -
Return the transport component to service. Enabling maintenance mode set
HubTransportto Draining, and it has to be set back explicitly — reactivatingServerWideOfflinealone does not do it:Set-ServerComponentState <ServerName> -Component HubTransport -State Active -Requester Maintenance -
Verify:
Get-ServerComponentState <ServerName> | ft Component,State -AutoSizeAll server components should show Active.
Before returning the server to production traffic
Check HubTransport specifically in the verification output. A server whose HubTransport is still draining will not accept mail, even though the rest of it looks healthy — and nothing else in the output makes that obvious.
If HubTransport does not show Active, re-run step 3 of the disable procedure and verify again before putting the server back into service.
Applies to
This procedure has been tested on Exchange Server 2016.
Comments
0 comments
Please sign in to leave a comment.