Run service with administrator privileges

前提是你 提交于 2019-11-28 04:32:59

问题


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


回答1:


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

Usually though it's best to run as an ordinary user and give it explicit permissions to the resources it needs access to.



来源:https://stackoverflow.com/questions/22888712/run-service-with-administrator-privileges

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!