Issue:
When attempting to upgrade to a later version of Exchange Cumulative Update (CU) you receive the below error.
Cannot start service MSExchangeServiceHost on computer
You find that a number of Exchange services are automatically set to disabled as part of the update process but don’t reset to automatic, therefore, causing the above message to trigger. From the research I carried out, this issue has been experienced by users performing an update on different versions of Exchange and there doesn’t seem to be a permanent resolution at the time of writing this post. For some reason the process does not set the services back to automatic.
It’s impossible to start the Exchange Services manually as there are a few services that need to be set manually from disable to automatic and at the right time. Running the below script can help but you need to be constantly keeping an eye on when the services are disabled and the script needs to be triggered at the right time before the wizard passes to the next stage. A number of people failed at running the script below.
Get-Service *Exchange* | Set-Service -StartupType Automatic
I located a useful script posted on the Microsoft Blog within the comments section by a user named wandersick.
Note: ensure you have a backout plan in the event you need to roll back.
Here is the fix:
- Back up the original service startup types (Automatic/Manual/Disabled)
- Create a loop script to keep enabling the services during the CU upgrade. The script is:
while (1 -le 2) { sleep 1 ; Get-Service | where{$_.DisplayName -Like ‘Microsoft Exchange*’} | Set-Service –StartupType ‘Automatic’ }
3. After the upgrade, service startup types were manually restored from Automatic to their original settings
Thanks to wandersick for providing this solution