Vaccano
Vaccano

Reputation: 82291

Starting Windows Service with Domain User Gives: Error 5: Access is Denied

I have a Topshelf Windows Service that installs and starts just fine when I run it as local system.

But when I switch to a domain user (or network service), I get the following error:

Windows could not start the My Cool Custom Service service on Local Computer.

Error 5: Access is denied.

I am left wondering if it is my domain user that I am running the service as that does not have permissions, or if it is me personally that does not have permissions to start a service as a non Local System user.

How can I get this service to start up?

NOTES:

Things I have tried:

Upvotes: 0

Views: 1472

Answers (1)

Vaccano
Vaccano

Reputation: 82291

I decided to try to work around this by running as Local System and then impersonating the user I want to make my calls.

Well, turns out that this issue is that my Windows Service starts up a self hosted SignalR service at startup. That call is what was giving the Access is Denied error.

If I let Local System start the SignalR service then do the rest of the stuff with my domain user it works fine.

(I will likely post a question on how to grant my user rights to start a SignalR service...)

Upvotes: 2

Related Questions