DotNetCore.WindowsService
DotNetCore.WindowsService copied to clipboard
Stopping and starting a service without admin rights
Hello Peter,
I've succesfully used your windows service library in a number of applications running under net core. So thanks a lot for the nice integratable solution.
I just have one issue.
I have a service, installed as an admin user (necessary for the application). The current logged in user is a normal user, with no option to elevate rights. For updates, new files are downloaded, the service is stopped, files are renamed, and the service is started.
What I'm noticing is that for starting and stopping a service, installed/running under an admin account, elevated rights are necessary.
Is there a way we can call the install command, so that start and stop rights are granted to all users?
I've found a similar question/response on stack overflow, where there is an instructionset on how to do it using windows, but it would be perfect if those rights could be set using the install command.
Link: https://stackoverflow.com/questions/10850595/windows-service-start-and-stop-without-admin-privileges
You're welcome, glad it was useful to you.
I am afraid I don't have a clear answer for this for you though. I think it might be possible somehow but as it is not useful for me, you will either have to create a PR for this yourself or wait for somebody to work on this.
This lib was initially created to power microservices, as such it was expected to always have admin access. I am happy to support any other use cases though by merging in PRs