Is there a way to control the order in which services are stopped on a system shut-down?
We are having issues with our domain-controller, which takes forever to shut down (if it goes down at all) because of a mistake in the order the services are shut down (First domain services, then Exchange).
I could write a script to stop Exchange first and then shut down the machine, but would really like to be able to just issue a shutdown /r /t 1
and not have to think about it.
So, is there a way to control the order in which services are stopped/started on system stops/starts?
Write the script. Assign it to the computer as a shutdown script. This script will be processed before any services are stopped.
How to create a dependency between Windows services
regedit
to open your registry.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
and locate the service that you need to set a dependency for.DependOnService
key on the right side. If the selected service does not have aDependOnService
key, then create one by right-clicking and selecting New > Multi-String Value.You could use this method to force dependencies between services, but it is undocumented.
The real question is why is Exchange Server delaying the shutdown. Exchange shouldn't be delaying the system shutdown like this. It sounds like this real issue needs to be addressed.
From msexchange.org:
Just guessing - can you make the Exchange service(s) dependent on the domain services? I should think Windows would then shut down Exchange first, before shutting down what they depend on.