RunAs 在 LocalSystem C# 下运行
我们正在尝试执行一个进程,假设使用另一个用户名凭据执行“cmd.exe”。该应用程序作为 WCF 服务在 LocalSystem 帐户下运行。 我们尝试了几种方法(Process.start、CreateProcessWithLogOn 等),但所有方法似乎都因“访问被拒绝”而失败。
有谁知道该怎么做?有什么办法可以做到吗?
var myProcess = new ProcessStartInfo(path)
{
UserName = username,
Password = MakeSecureString(password),
UseShellExecute = false, LoadUserProfile = true
};
We are trying to execute a process, let's say "cmd.exe" under another username credentials. The application is running as a WCF service under LocalSystem account.
We have tried several methods(Process.start, CreateProcessWithLogOn, etc) and all seem to fail with "Access denied".
Does anyone know how to do it? Is there any way out there to do it?
var myProcess = new ProcessStartInfo(path)
{
UserName = username,
Password = MakeSecureString(password),
UseShellExecute = false, LoadUserProfile = true
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论