psexec.exe在系统上下文中运行PowerShell脚本时会引发错误 - 错误在{MachineName}上创建键文件:访问被拒绝
我试图使用PSEXEC在系统上下文中运行PowerShell脚本,但是获得错误,
C:\Users\{myUserName}>PsExec.exe -i -s "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe"
PsExec v2.34 - Execute processes remotely
Copyright (C) 2001-2021 Mark Russinovich
Sysinternals - www.sysinternals.com
Error creating key file on {MachineName}:
Access is denied.
这只是为了打开使用系统帐户的PowerShell终端。我的最终游戏是使用PSEXEC创建一个PBK文件,类似于
psexec.exe -i -s powershell.exe .\convertXML.ps1 -xmlFilePath .\vpntemplate.xml -ProfileName "TestVPN"
我使用的资源在此处使用配置Windows 10中的VPN设备隧道
I am trying to run a powershell script in the System context using PsExec, but get the error
C:\Users\{myUserName}>PsExec.exe -i -s "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe"
PsExec v2.34 - Execute processes remotely
Copyright (C) 2001-2021 Mark Russinovich
Sysinternals - www.sysinternals.com
Error creating key file on {MachineName}:
Access is denied.
This is simply to open up a PowerShell terminal with the system account. My end game is to use PsExec to create a PBK file like this
psexec.exe -i -s powershell.exe .\convertXML.ps1 -xmlFilePath .\vpntemplate.xml -ProfileName "TestVPN"
I am using the resources referenced here Configure VPN device Tunnels in WIndows 10
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@zett42当我打开命令窗口以管理员的身份并尝试您的命令时,它会按照我的预期工作。
另外,我认为正是Psexec的Eula引起了问题,因为我跑了这个,而且效果也很完美
@zett42 when I opened a command window as an administrator and tried your command, it worked as I expected.
Alternatively, I think it was psexec's EULA that was causing problems because I ran this and it worked flawlessly as well
这可能是原因:
PSEXESVC.EXE被攻击表面降低(ASR)规则所阻挡“源自PSEXEC和WMI命令的块过程创建”。
This can be the cause:
PSEXESVC.exe was blocked by the attack surface reduction (ASR) rule "Block process creations originating from PSExec and WMI commands"