如何模拟用户启动/停止Windows服务? [英] How do I impersonate a user for start/stop a windows service?

查看:64
本文介绍了如何模拟用户启动/停止Windows服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Windows窗体,用服务控制器来操作Windows服务。

当我尝试启动它时,应用程序返回访问被拒绝 。

如果我以管理员身份运行应用程序,我可以启动它并停止它。

如果我以普通用户身份运行应用程序,我就无法做任何事情。 />
我必须冒充一个拥有管理员权限的用户然后操纵它。

有什么想法吗?

非常感谢

解决方案

请参阅 https://www.google.com / search?q = windows%20impersonate%20user [ ^ ]。

Hi ,
I have a windows form that manipulate a windows service with service controller.
When I try to start it, the application return me "access denied".
If I run the application as admin, I can start it and stop it.
If I run the application as normal user i can't do anything.
I have to impersonate a user who has admin permission on a machine and then manipulate that.
Any idea?
Thank you very much

解决方案

See https://www.google.com/search?q=windows%20impersonate%20user[^].


这篇关于如何模拟用户启动/停止Windows服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆