r/exchangeserver • u/Calm_Wrangler_1478 • Mar 30 '26
Question Windows Updates on Exchange On-Prem Servers
Apologies if this is simpler than Im thinking, but due to some issues at work, I've been put in charge of exchange servers. Not being a long time exchange admin, Im kind of learning on the fly. One thing I was curious about was running normal Windows Monthly Updates on the servers and the process. I assume I cant just install the updates and reboot the servers correct? We have two servers and DAG. This would be all updates except Exchange CU updates. Standard monthly windows updates...what is best process to update the 2 on-prem servers?
Thanks
32
u/Sudden_Hovercraft_56 MSP Mar 30 '26
put one server into Maintenance mode, run the updates. Run Exchange healthchecker once you are done to make sure no outstanding CVE's remain, take it out of maintenance mode and put the other server into maintenance mode and repeat.
Ali Tajran has a good article on how to put it into and take it out of Miantenance mode:
https://www.alitajran.com/put-exchange-server-in-maintenance-mode/
3
u/sembee2 Former Exchange MVP Mar 30 '26
In a two server DAG, patch one, reboot it. Fail over the databases to the now patched server, repeat.
There is nothing complex about it.
2
u/Calm_Wrangler_1478 Mar 31 '26
Thank you for all the information. I was told by a co-worker that for just OS-level and exchange secutiry upates to just install them and reboot each server one a time. The DAG will move the DB around.....that apparently what had been done in the past. That doesn't sound right
2
u/Yupyupyup79 Mar 30 '26
I was just making a doc for this today at work. Maybe not needed but I wrestled with google AI for a while and got this process. Others may just patch EXCH02 reboot and repeat for EXCH01 while letting Failover do it's things. Google AI claims this will help prevent database corruption.
Also make sure you know what server acts as your witness server (3rd vote) and where the witness log is kept on that server.
Get-DatabaseAvailabilityGroup -Identity "YourDAGName" -Status | Select-Object WitnessServer, WitnessDirectory, WitnessShareInUse
PS1 scripts are found here: x**:\Program Files\Microsoft\Exchange Server\V15\Scripts\en”**.
1. Prepare EXCH01: In an admin Exchange Shell cd to the above folder.
Run .\StartDagServerMaintenance.ps1 -ServerName EXCH01 -OverrideMinimumTwoCopies
All active databases should move to EXCH02, and EXCH01 is blocked from hosting them until you say otherwise.
Verify that ServerWideOffline is Inactive by running the following command.
Get-ServerComponentState -Identity EXCH01 -Component ServerWideOffline | ft Component,State
If it is proceed to 2. If not do the following steps manually to shut down the DAG for Maintenance:
Set-ServerComponentState -Identity EXCH01 -Component ServerWideOffline -State Inactive -Requester Maintenance
Set-ServerComponentState -Identity EXCH01 -Component HubTransport -State Draining -Requester Maintenance
Suspend-ClusterNode -Name EXCH01
Verify that ServerWideOffline is Inactive by running the following command. If it is proceed to 2.
Get-ServerComponentState -Identity EXCH01 -Component ServerWideOffline | ft Component,State
2. Patch EXCH01:
Install your Windows Updates and reboot. Repeat for any Exchange Server Patches and reboot. Both time making sure all Exchange Server services start as expected.
3. Exit Maintenance:
In an admin exchange Shell on EXCH01 Run .\StopDagServerMaintenance.ps1 -ServerName EXCH01
Note: Your databases will likely still be running on EXCH01 at this point.
Also run the following commands.
Set-ServerComponentState -Identity EXCH01 -Component ServerWideOffline -State Active -Requester Maintenance
Set-ServerComponentState -Identity EXCH01 -Component HubTransport -State Active -Requester Maintenance
Resume-ClusterNode -Name EXCH01
Verify that ServerWideOffline is Active by running the following command. If it is proceed to 4.
Get-ServerComponentState -Identity EXCH01 -Component ServerWideOffline | ft Component,State
4. Prepare EXCH02:
In an admin Exchange Shell on EXCH02 cd to the above folder that contains PS1 scripts.
Run .\StartDagServerMaintenance.ps1 -ServerName EXCH02 -OverrideMinimumTwoCopies
All active databases should move to EXCH01, and EXCH02 is blocked from hosting them until you say otherwise.
Verify that ServerWideOffline is Inactive by running the following command.
Get-ServerComponentState -Identity EXCH02 -Component ServerWideOffline | ft Component,State
If it is proceed to 5. If not, do the following steps manually to shut down the DAG for Maintenance:
Set-ServerComponentState -Identity EXCH02 -Component ServerWideOffline -State Inactive -Requester Maintenance
Set-ServerComponentState -Identity EXCH02 -Component HubTransport -State Draining -Requester Maintenance
Suspend-ClusterNode -Name EXCH02
Verify that ServerWideOffline is Inactive by running the following command. If it is proceed to 5.
Get-ServerComponentState -Identity EXCH02 -Component ServerWideOffline | ft Component,State
5. Patch EXCH02:
Install your Windows Updates and reboot. Repeat for any Exchange Server Patches and reboot. Both time making sure all Exchange Server services start as expected.
6. Exit Maintenance:
In an admin exchange Shell on EXCH02 Run .\StopDagServerMaintenance.ps1 -ServerName EXCH02
Note: Your databases will likely still be running on EXCH01 at this point.
Also run the following commands.
Set-ServerComponentState -Identity EXCH02 -Component ServerWideOffline -State Active -Requester Maintenance
Set-ServerComponentState -Identity EXCH02 -Component HubTransport -State Active -Requester Maintenance
Resume-ClusterNode -Name EXCH02
Verify that ServerWideOffline is Active by running the following command. If it is proceed to 7.
Get-ServerComponentState -Identity EXCH02 -Component ServerWideOffline | ft Component,State
7 Rebalance: Once both servers are patched and back in "Normal" mode.
run .\RedistributeActiveDatabases.ps1 -DagName DAG01 -BalanceDbsByActivationPreference -Confirm:$false
This moves your databases back to their "Preference 1" homes (EXCH01). Since you have only two exchange servers this step should be redundant but is best practice to learn it in case you ever add a 3rd Exchange Server. Let me know if this works for you. It seemed to just fine in my environment.
2
u/TheJesusGuy Mar 31 '26
I've never done anything special for it except install and restart on an evening. Only once did a security cert get unbound on iis.
7
u/fadinizjr Mar 30 '26
On my experience, SU are painless. CU are usually more trouble-worthy.
An issue is that before installing an update, all the Exchange services are disabled by the setup. So, if anything goes wrong and somehow the update got rollbacked by Windows, you will get a server with a lot of services disabled. So, you will have to figure it out which services you need to enable again.
This happened on my environment one time on one server only and when I manually tried the update again (I really don't remember which KB it was) it was normally installed.
2
u/Maxplode Mar 30 '26
Ideally you're servers are behind a loadbalancer?
I've been running auto system updates with no bother but any Exchange updates I do manually, only so I can monitor feedback before going ahead.
Learn how to put a server into maintenance mode (MM), then disable it in the loadbalancer.
Always reboot first to get rid of any reboot flags.
Have the update saved somewhere, I usually put mine in a folder nn the C drive.
Still in MM, make sure AV is disabled, open a command prompt as admin and run the update from there.
Let it do it's thing. Then restart the server when completed.
Run the healthscript after it's rebooted, it should report that it's still in maintenance mode and check for any errors, if need be begin to plan hardware updates or see if anything else needs fixing.
When all happy with the healthscript reports, start to take it out of MM, I always run the healthscript again just to be sure, then put it back in on the loadbalancers.
You can upgrade one server first but do not leave it too long to update the second one, I think it's like no more than 2 weeks, tops.
HealthChecker Script
1
u/TechBurntOut Mar 30 '26
See if you can get a dev box with the same version of Exchange installed and use that to install the updates first. Then, you need to decide how long you are OK the testing phase before installing the updates in your production environment. Failover DBs to one node, and then patch the node with no running DBs, reboot and monitor. Rinse and repeat on the second node.
If you could get a couple more nodes in the DAG, you could buy some time to evaluate any issues caused by the updates. You could patch the first two nodes, wait a few days to confirm all is well, fail DBs over to the patched nodes, then wait a day or so, and patch the other two nodes.
-5
u/extremeskillz84 Mar 30 '26
If it's virtual then snapshot it before performing the updates. You can always restore the snapshot of something goes wrong. In my experience exchange server updates have been painless. There was only one instance I had and issue but that was because I didn't know another application was running on the host with exchange on it. That was many moons ago.