How to Add a Dependency to a Windows Service

Windows ServerWhile I was blogging about implementing SmartConnect, I mentioned that the service account should be either set as delayed start or have a dependency added.

The former option, making it delayed start, can be done through the Services control panel applet, you can’t add a dependency this way. Instead the dependency can be added via a command.

The service can be changed by using the sc.exe which is a component of Windows. To use the command we need to know the Service name of both the service we want to add the dependency to and also the service name of the service it will be dependent on.

In my example, I am adding a dependency to the eOne SmartConnect Service; to find the Service name, open Services from the Control Panel, rich-click the service and locate the Service name:

eOne SmartConnect Service Properties

Repeat this for the service on which the first service is to be dependent:

SQL Server (GP) Properties

The command is run via the Command Prompt; the command is as follows (replace the highlighted sections with the service names retrieved as above):

sc config {service to have the dependency added} depend={service to be dependent on}

sc config eOne.SmartConnect.WindowsService.exe depend=MSSQL$GP

Once the command has been run, you can check the Properties of the service and make sure the dependency is correctly listed:

eOne SmartConnect Service Properties

Can ISC Software Solutions help?

ISC Software Solutions are UK and Ireland based experts on Microsoft Dynamics GP. If you'd like to speak to someone about support, consultancy, upgrades, implementation, development, GP Elementz add-ons or portals, or anything else Dynamics GP related, you can use the form below.
Your Name (required):
Your Email (required):
Enquiry message:

What should we write about next?

Your Name (required) -
Your Email (required) -

1 thought on “How to Add a Dependency to a Windows Service

Leave a Reply

Your email address will not be published. Required fields are marked *