PSEXEC-“句柄无效"以系统用户身份运行命令时 [英] PSEXEC - "The Handle is invalid" When running the command as System User
问题描述
如果从用户生成的命令提示符下运行,这是可以正常运行的命令:
This is the command that works fine if run from a user-spawned command prompt:
PSEXEC \\xxx.xxx.xxx.xxx -u xxxx -p xxxx -accepteula cmd /c "TYPE C:\Pyxislog\PYXIS01.log|Find/i "%ID%"" >nul
但是,如果我尝试从系统调用的cmd提示符下运行此命令,则会得到此消息:
However, if I try to run this from a system-invoked cmd prompt I get this:
Couldn't access 10.219.149.65:
The handle is invalid.
Connecting to 10.219.149.65...
它必须以系统用户身份运行,因为它将通过以系统用户身份运行的远程软件工具进行部署.这是psexec的限制吗?是的,用户名和密码具有管理权限.
It has to run as a system user, since it will be deployed via a remote software tool which runs as a system user. Is this a limitation of psexec? and yes, the Username and password have administrative rights.
推荐答案
经过大量研究,它是Windows安全功能,用于阻止对系统用户的所有网络访问,其中包括以另一个用户身份运行任务.我发现规避此问题的最佳方法是创建一个计划任务,以从管理员帐户运行psexec.
After much research, it is a windows security feature to block all network access to the system user, which includes running tasks as another user. The best method I have found to circumvent this , is to create a scheduled task to run psexec from an administrator account.
这篇关于PSEXEC-“句柄无效"以系统用户身份运行命令时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!