C#. How to programmatically grant User Log On as a Service

有些话、适合烂在心里 提交于 2019-12-04 16:20:51

问题


I've searched through the internet, but haven't found any solution in c#. Does anybody know how to give user right to log on as a Service in c#?


回答1:


EDIT: I found an article on CodeProject with sample code that shows exactly how to do this!

I assume you've already found this KB that shows how to do it with native code. I'm looking for a C# way as well.




回答2:


I tried in vain to find this. The way I did it in the end was to package the NTRights executable with my application and then launch it as a separate process.

NTRights can be found on the server 2003 resource kti and its usage is documented here: http://support.microsoft.com/kb/315276



来源:https://stackoverflow.com/questions/1286795/c-how-to-programmatically-grant-user-log-on-as-a-service

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