以不同用户身份运行 Services.msc C#
我需要创建一个简单的 Windows 窗体应用程序,允许管理员用户管理远程服务器上的服务。我们不想向管理员提供服务器的用户名和密码,因此这些内容将被加密并存储在数据库中。
我的问题是,在模拟数据库中存储的用户之一时是否可以生成 Services.msc
窗口?
我已经查看了 ProcessStartInfo 类,但由于 Services.msc
不是可执行文件,因此它似乎不喜欢执行该类。关于执行实际模拟和加载 Services.msc
的简单方法(例如单击按钮)有什么想法吗?
I have a requirement to create a simple windows forms application that allows an admin user to manage the Services on remote servers. We don't want to give the admins the usernames and passwords to the servers so these will be encrypted and stored in a database.
My question is whether or not it is possible to spawn a Services.msc
window when impersonating one of the users stored within the database?
I have looked at the ProcessStartInfo
class but because Services.msc
is not an executable it does not seem to like executing this. Any ideas on a simple way of doing the actual impersonation and loading of Services.msc
- say off a button click?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
文件扩展名 msc 与 mmc.exe 关联。您需要开始以下操作:
File extension msc is associated with mmc.exe. You'll want to start the following:
斯彭德速度更快,所以他获得了积分。这就是我所做的,以防万一它对某人有用。
Spender was faster, so he gets the credits. Here is what I did, just in case it is useful to someone.