I have a windows service project implementation that I am trying to install as network service.
process = new ServiceProcessInstaller();
process.Account = ServiceAccount.NetworkService;
however whenever I try to start the service I get :
System error 5 has occurred.
Access is denied.
This comes after running the net start MyService
command in the visual studio command prompt which is running as administrator by the way.
Any help on how to get this to work? Thanks.
The "Access denied" message applies to the user trying to start the service, not the account in which the service is run.
Can you start the service from:
I would check that the Network Service account has permissions to execute. Steps to check:
Your
Net Start MyService
is probably not running with escalated privileges. Your command requires (I believe) Administrative Privileges.Update
Not sure why, but your privileges on your service are weird. By default privileges of services should look like:
However your's looks like:
I'm not sure exactly how that came to be. Try uninstalling and reinstalling?
You can download SddlParse (google it :) to parse out the Security Descriptor Definition Language.