During a roll-up update on Exchange Server 2016, I had some issues with the CU. The problems I had with it and the solution I found were described in a post on my blog at MSB365. However, what I didn’t describe in the other article was another phenomenon of Exchange Services. By updating the second Exchange Server, I ran into another error. It showed me that the setup progress was not able to stop or start the Exchange Services. After having a look at them, I noticed that all of them were disabled. The problem, in this case, is that they were disabled and not just stopped. Had they been just stopped, we could reboot the Exchange Server and the chances would be high that the Exchange Services will run again. However, with Exchange Services disabled, this is not that easy. We need to change the startup type from disabled to automatic. There are two common ways we can do that: We can start each of them manually in the Services Snap-in (not really recommended) or we use PowerShell to do it for us.
Of course, I chose the second option! Here are the steps I used:
Finding the right Exchange Services
First, we have to know which services there are and which need to have their startup type changed. I used the Get-Service cmdlet to find out. In my case, I was just interested in the Exchange Services, so I needed to filter them with the following command:
Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *”} | ft Name,Status
Change the status
The output told me which services needed to have their startup type changed. To do that, I only had to change the entry after the last Pipe. (To change the startup type I don’t need a displayed output, but I need to change the startup type for the selected services.) This I did with the following cmdlet:
Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Set-Service –StartupType Automatic
The Exchange Services startup type was changed from disabled to automatic. But they were still not running. To start the services, we can use the following cmdlet:
Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Start-Service
This command can take a while until it is finished. The reason for that you will see in your PowerShell console. All of the services need to be started and PowerShell is doing that in a serial way (not in a parallel way). However, from my point of view, this is good, because we are able to see what is happening with each of the services and if we have any other issues.
Next step, IIS
After the Exchange Services have all changed their startup type and status, we are almost done. There is another service we also have to think about — IIS.
To edit the IIS Admin Service, we can follow the same concept as we did with the Exchange Services. First, we need to identify the services and set the startup type to automatic. For that, we can use this cmdlet:
Get-Service | Where-Object { $_.DisplayName –eq “IIS Admin Service” } | Set-Service –StartupType Automatic
Last but not least, we also need to start IIS Admin Service. This we can do with the following cmdlet:
Get-Service | Where-Object { $_.DisplayName –eq “IIS Admin Service” } | Start-Service
From this point, I was able again to continue my CU update. These commands work for all kind of services we need to modify. In the Exchange case, we need to make sure that the POP3 and IMAP4 services are also started and the startup type is set to automatic. These services normally have the following settings:
Name | Status | Startup Type |
Microsoft Exchange IMAP4 | Stopped | Manual |
Microsoft Exchange IMAP4 Backend | Stopped | Manual |
Microsoft Exchange Notification Broker | Stopped | Automatic |
Microsoft Exchange POP3 | Stopped | Manual |
Microsoft Exchange POP3 Backend | Stopped | Manual |
Microsoft Exchange Server Extension for Windows Server Backup | Stopped | Manual |
I hope this will help you have less headaches if you run into this kind of problem. In my case, it did the job.
An alternative way
However, if the Get-Service commands are not responding, we still have a Plan B. Here we can use the Get-WMIObject cmdlets. Again, we need to identify the Exchange Services and after that, we start them. The command looks like this:
Get-WMIObject win32_service | Where-Object {$_.name -match "exchange" -and $_.startmode -eq "Auto" -and $_.state -ne "running"} | Start-Service
By the way, if we remove the name check, we can do that for all services. As an example the command would look like this:
Get-WMIObject win32_service | Where-Object {$_.startmode -eq "Auto" -and $_.state -ne "running"} | Start-Service
You can find more about this on my blog by following the link here.
Exchange Services disabled? Don’t panic
This article is a brief introduction on how to change the startup type of Microsoft services, explained using a real with Exchange Server. It works with other services as well. However, if you don’t feel comfortable using PowerShell for editing servicea, I highly recommend you have a look at articles on Microsoft TechNet or my MSB365 blog.