Exchange 2013/2016: Cumulative Update Deployment in Production without any Outage
This document provides the steps to update Exchange infrastructure to the latest Cumulative Update (CU).
Prepare Active Directory:
Every update comes with some or the other change in the Active directory. So it is better to run all the active directory update setups before running the setup to avoid any last minute surprise.
Follow the steps mentioned in the blog here to prepare your active directory. This blog was originally written for Exchange 2016 but active directory update steps and commands are same in Exchange 2013 and 2016. So we can follow this blog.
The only thing changing here is the setup binary files. Rest commands and steps are same.
Pre-Installation Hand off:
In a production setup you would like to avoid any disconnection or delayed mail because of windows patching or Exchange Cumulative update. So we should focus on proper hand off to another server before running the setup.
The following commands take care of the hand off:
- Select server that will be put into maintenance mode in preparation for CU
-
Drain active mail queues on the mailbox server
Set-ServerComponentState <ServerName> -Component HubTransport -State Draining -Requester Maintenance
-
To redirect messages pending delivery in the local queues to another Mailbox server run:
Redirect-Message -Server <ServerName> -Target <MailboxServerFQDN>
Note: The Target Server value has to be the target server’s FQDN and that the target server shouldn’t be in maintenance mode
- Restart-Service MSExchangeFrontEndTransport
-
Restart-Service MSExchangeTransport
-
To move all active databases currently hosted on the DAG member to other DAG members, run
Set-MailboxServer <ServerName> -DatabaseCopyActivationDisabledAndMoveNow $True
This may not move the active databases to the other servers because other servers might have Database copy activation blocked so run the below command for the other servers then rerun the command.
Set-MailboxServer <ServerName> -DatabaseCopyAutoActivationPolicy Unrestricted
Set-MailboxServer <ServerName> -DatabaseCopyActivationDisabledAndMoveNow $True
If database don’t move by running above commands, then the below command to move the databases
Move-ActiveMailboxDatabase -activeoneserver <ServerName>
.
-
To get the status of the existing database copy auto activation policy, run the following and note the value of DatabaseCopyAutoActivationPolicy, we will need this when taking the server out of Maintenance in the future
Get-MailboxServer <ServerName> | Select DatabaseCopyAutoActivationPolicy
-
To prevent the server from hosting active database copies, run
Set-MailboxServer <ServerName> -DatabaseCopyAutoActivationPolicy Blocked
-
To put the server in maintenance mode run:
Set-ServerComponentState <ServerName> -Component ServerWideOffline -State Inactive -Requester Maintenance
Note: Closely monitor the transport queue before running the step above. Queues at this stage should be empty or nearly empty, as we will be disabling all server components. Any mails still pending in the queues will have delay in delivery till the server is taken out from maintenance mode.
-
To prevents the node from being and becoming the PAM, pause the cluster node by running
Suspend-ClusterNode <ServerName>
-
To verify the server has been placed into maintenance mode, run:
Get-ServerComponentState <ServerName> | ft Component,State –Autosize
All components should show “Inactive” except for Monitoring and RecoveryActionsEnabled
PrePatching script can be downloaded from here https://gallery.technet.microsoft.com/Exchange-2016-and-Exchange-e46ba457
Installation:
Apply Exchange 2013 Cumulative Update on the server that is now in maintenance mode.
- Restart the server
Make sure server has latest CU update installed then restart the server.
Post-Installation unblocking:
To designate that the server is out of maintenance mode and be able to resume its previous tasks, run the following commands:
- Set-ServerComponentState <ServerName> -Component ServerWideOffline -State Active -Requester Maintenance
- Resume-ClusterNode <ServerName>
- Set-MailboxServer <ServerName> -DatabaseCopyActivationDisabledAndMoveNow $False
- Set-MailboxServer <ServerName> -DatabaseCopyAutoActivationPolicy Unrestricted
- Set-ServerComponentState <ServerName> -Component HubTransport -State Active -Requester Maintenance
- Restart-Service MSExchangeTransport
-
Restart-Service MSExchangeFrontEndTransport
To verify the server is not maintenance mode, run the following commands:
- Get-ServerComponentState <ServerName> | ft Component,State –Autosize
- All server components should show as “Active”
This procedure must be done for all Exchange servers. First of frontend Exchange servers then on the backend servers.
Once completed run the below mentioned commands to balance the database and move the PAM
- .\RedistributeActiveDatabases.ps1 -DagName DAGName -BalanceDbsByActivationPreference -ShowFinalDatabaseDistribution -Confirm:$false
- cluster.exe DAGNAme group “Cluster Group” /MoveTo:PAMServerName
Post-Patching script can be downloaded from here: https://gallery.technet.microsoft.com/Exchange-2016-and-Exchange-47b53102
Microsoft MVP | Exchange Server
Team@MSExchangeGuru
December 28th, 2015 at 7:46 am
Thanks, This is a great post and very clear instructions.
December 28th, 2015 at 7:05 pm
Hi Prabhat,
Thanks for sharing the article.
Does this methods also works for Exchange Server 2010 or 2013 as well ?
December 28th, 2015 at 8:08 pm
For 2013 yes. For 2010 it will work as well but there is no front end transport so few things may not work like this. Let us know if you try.
December 30th, 2015 at 5:42 am
Thanks
May 18th, 2016 at 9:57 am
Hi Prabhat,
Really a great post. Do you need to use these steps even if you have only one mailbox and one CAS server? also, do you have any suggestion or article to move exchange 2013 mailbox (single server) from one host to other in VMWare envionment. Should I shut it down and then move or better to do it while it is running? Thanks
Samir
May 25th, 2016 at 3:22 pm
Some of the commands will not work for single server. This is for a DAG setup.
VMware should have been a clustered virtual setup and in that case we could have moved from Failover cluster manager.
If you don’t have clustered VMware then you have to shutdown and move only if you have same hardware.
You can also install new server and move mailboxes.
October 2nd, 2016 at 4:44 am
[…] https://msexchangeguru.com/2015/12/26/exchange-update-deployment-process/ […]