Starting a service with administrator privileges

I am developing an application that runs as a Windows service. I really need a service in order to have administrator rights. I tried with the LocalSystem user and he does not have enough rights. Is it possible? I tried setting requireAdministrator in app.config. When I do this, the service starts and then stops immediately. I also tried with other admin accounts, but get the same results.

+4
source share
1 answer

You just need to run it as the admin user - correctly enter the login in the properties of the services for the service.

Usually, although it’s best to run as a regular user and give him explicit permissions to resources that he needs access to.

+2
source

Source: https://habr.com/ru/post/979434/


All Articles