[英]Run PsExec from C# with admin right without UAC
I want to run a PSExec
action, that need admin right, from a C#
app launch from user space.我想从用户空间启动
C#
应用程序运行需要管理员权限的PSExec
操作。 Of course, the complication, that's I don't want the UAC.当然,复杂的是,我不想要 UAC。
I want to run an action like this:我想运行这样的操作:
PsExec.exe -i -s powershell.exe -command "whoami *> 'out.txt'"
verb = "runas"
, it's workingverb = "runas"
的进程的示例,它正在工作I've tried a lot of other things, but I've not find a good trick.我已经尝试了很多其他的东西,但我没有找到一个好的技巧。 (powershell with credential, run a.bat or.ps1, ...)
(带有凭据的powershell,运行a.bat or.ps1,...)
I'm open to every solution and/or if it's really doable.我对所有解决方案和/或是否真的可行持开放态度。
You cannot do this.你不能做这个。 Windows is a secure operating system, and you need to be an administrator to perform administrator tasks.
Windows 是一个安全的操作系统,您需要成为管理员才能执行管理员任务。
Pretend for a moment that UAC doesn't exist.假装 UAC 不存在。
PsExec
to run something as the System
accountPsExec
作为System
帐户运行某些东西You cannot.你不能。 A standard user is not allowed to compromise the security of the system like that.
不允许标准用户像那样危及系统的安全性。
The only way you can do that is to run as an Administrator.您可以这样做的唯一方法是以管理员身份运行。
Windows Vista, and UAC, made it easier than having to completely switch to another user: Windows Vista 和 UAC 比完全切换到另一个用户更容易:
But you cannot just arbitrarily elevate yourself to an administrator - that defeats the entire purpose of having a secure operating system.但是您不能随意将自己提升为管理员——这违背了拥有安全操作系统的全部目的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.