These commands are mostly useful while upgrading CUs on Exchange 2013/2016 and if there is some kind of maintenance that requires stopping Exchange services.
Status of the Exchange Services can be seen two ways – in Control Panel\Administrative Tools\Services or via Exchange Management Shell
Exchange Management Shell command is
Get-Service | Where-Object { $_.DisplayName -like "Microsoft Exchange *" } | ft Name,Status
In Services, Exchange related services are looking like this
Disabling or stopping Exchange Services
Disabling Exchange Services
Now, in order to disable all Exchange Server Services, run following command
Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Set-Service –StartupType Disable
Everything is disabled.
Stopping Exchange Services
If we wanted to just stop Exchange Services, following command is needed
Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Stop-Service
Only one Exchange Service failed to stop and that is Microsoft Exchange Active Directory Topology.
You can stop it manually in Services, if it also fails for you.
Starting Exchange Services
Enabling Exchange Services
You can enable Exchange Services with following command
Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Set-Service –StartupType Automatic
Starting Exchange Services
Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Start-Service
For best results with these commands, restarts of the server are desirable with each of these commands.