Use ServiceController to start service with different account
I am using a class ServiceController
to start a (installed) installed service, for example:
var newServiceController = new ServiceController("theNameOfMyService");
newServiceController.Start();
The problem is that the service always runs under the local system account, and instead I want it to run under my account.
Can anyone tell me how to use ServiceController
to run the service under a different account?
0
a source to share