PSEXEC,访问被拒绝错误
当我使用 PSEXEC.exe 时,远程系统出现“访问被拒绝”错误。
知道如何解决这个问题吗?
While I'm using PSEXEC.exe getting 'Access denied' error for remote systems.
Any idea about how to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(20)
我有同样的问题。 经过一番努力,我找到了一个简单而完整的解决方案:
代码如下所示:
如果您想在另一台计算机上调试脚本,请运行以下模板:
I had the same problem. And after a hard work, I found a easy and full solution:
The code looks like this:
If you whant to debug your script in the another machine, run the following template:
尝试在目标(远程)计算机上设置此键,然后重新启动计算机:
请参阅:http://forum。 sysinternals.com/topic10924.html 和 http://www.brandonmartinez.com/2013/04/24/resolve-access-is-denied-using-psexec-with-a-local-admin-account/
Try setting this key on the target (remote) machine, and restart the machine:
See: http://forum.sysinternals.com/topic10924.html and http://www.brandonmartinez.com/2013/04/24/resolve-access-is-denied-using-psexec-with-a-local-admin-account/
我刚刚添加了“-с”参数。 它使 Psexec 副本可执行到远程计算机。 因此它可以正常工作而不会出现访问错误。
I just added "-с" parameter. It makes Psexec copy executable to remote machine. So it works without access errors.
我发现 Sophos 一直将 psexec.exe 放入隔离区。 一旦我授权它,它运行得很好。
I found Sophos kept placing psexec.exe into the Quarantine section. Once I authorized it, it ran fine.
即使在 win 10 上,我仍然使用
psexec
。将 Windows 10 的win32
文件夹中的psexec.exe
替换为旧版本即可工作 -> ; 我用的是2.11.0.0版本。 我使用的 Windows 10 版本仅在远程计算机上将 .bat 文件作为后台/隐藏进程运行。 花了一整天的时间才弄清楚这个问题。将上面的注册表项添加到远程计算机也有帮助:
I still use
psexec
, even on win 10. Replace thepsexec.exe
in the Windows 10'swin32
folder with the older version to work -> I use version 2.11.0.0. The Windows 10 version I was using would only run .bat files as background/hidden process on the remote computer. Took a whole day to figure this out.Adding the registry key from above to the remote computer helps as well:
我遇到过 AV 隔离 Psexec 的情况 - 必须禁用按访问扫描
I had a case where AV was quarantining Psexec - had to disable On-access scanning
我发现 PSEXEC(和其他 PS 工具)失败的另一个原因 - 如果某些东西(例如病毒或木马)隐藏了 Windows 文件夹和/或其文件,则 PSEXEC 将失败并出现“访问被拒绝”错误,PSLIST将给出错误“未找到处理器性能对象”,并且您将不知道原因。
您可以通过 RDP 进入; 您可以访问admin$共享; 您可以远程查看驱动器内容等,但没有迹象表明文件或文件夹被隐藏是原因。
我将在昨天仔细阅读的几个页面上发布此信息,同时试图确定这个奇怪问题的原因,因此您可能会在其他地方逐字地看到此信息 - 只是想在其他人拔出头发之前我会把这个词说出来从根源上试图理解为什么性能计数器与 PSEXEC 的运行有关。
I found another reason PSEXEC (and other PS tools) fail - If something (...say, a virus or trojan) hides the Windows folder and/or its files, then PSEXEC will fail with an "Access is Denied" error, PSLIST will give the error "Processor performance object not found on " and you'll be left in the dark as to the reason.
You can RDP in; You can access the admin$ share; You can view the drive contents remotely, etc. etc., but there's no indication that file(s) or folder(s) being hidden is the reason.
I'll be posting this information on several pages that i was perusing yesterday while trying to determine the cause of this odd problem, so you might see this elsewhere verbatim - just thought I'd put the word out before anyone else pulled their hair out by the roots trying to understand why the performance counter has anything to do with PSEXEC running.
对于任何可能偶然发现这一点的人。 Microsoft Windows 最近(2013 年 12 月)在 Windows 7 上发布了一个安全更新,该更新阻止远程执行。
请参阅http://support.microsoft.com/kb/2893294/en-us
我通过转到控制面板\程序\程序和功能\已安装的更新来卸载安全更新,
此后它就可以正常工作。
For anybody who may stumble upon this. There is a recent (Dec 2013) Security Update from Microsoft Windows on Windows 7 that is preventing remote execution.
See http://support.microsoft.com/kb/2893294/en-us
I uninstalled the Security Update by going to Control Panel\Programs\Programs and Features\Installed Updates
It worked right after that.
以下方法有效,但只有在我将 PSEXEC 从 Microsoft 升级到 2.1 后才有效。
我有一个稍旧的版本,没有不工作。 我用它通过 Dell kace 做了一些 USMT 工作,工作很愉快:)
The following worked, but only after I upgraded PSEXEC to 2.1 from Microsoft.
I had a slightly older version that didn't work. I used it to do some USMT work via Dell kace, worked a treat :)
在 Windows Server 2012 R2 上,我无法从用户帐户运行,
但如果不带参数
-h -s
运行,它就可以正常工作。 这就是为什么我用它来解决我的问题:On Windows Server 2012 R2 I had trouble to run from user account
But it works fine if you run without parameters
-h -s
. That's why I use this to solve my trouble:除非禁用了 UAC,否则我无法访问远程计算机。
这必须在本地完成,可以从控制面板或通过 cmd 运行以下命令:
启用 UAC 时,请确保以管理员身份运行 cmd >。
I couldn't get access to remote machines unless I had UAC disabled.
That has to be done locally, either from control panel or running the following through cmd:
While UAC is enabled, make sure you run cmd as administrator.
对于不同的命令,我决定将网络从公共网络更改为工作网络。
再次尝试使用 psexec 命令后,它再次工作。
因此,要使 psexec 正常工作,请尝试将网络类型从公共网络更改为工作或家庭网络。
For a different command I decided to change the network from public to work.
After trying to use the psexec command again it worked again.
So to get psexec to work try to change your network type from public to work or home.
我尝试了很多方法,但无法使用psexec。 它给出“访问被拒绝”。 将目标用户帐户类型从标准更改为管理员后,我通过 psexec 连接计算机。
我研究了需要管理员类型帐户的原因,然后发现 此答案。
您可以通过以下方式更改目标计算机用户帐户:控制面板 -> 用户帐户 -> 更改帐户类型。 如果您登录的是标准帐户,则必须输入管理员帐户和密码才能更改该帐户。
之后,我使用以下命令登录:
psexec \\remotepcname -u remoteusername -p remotepassword cmd
I tried a lot of way but I could not use psexec. It gives "Access denied". After I change the target user account type from Standard to Admin, I connected the machine via psexec.
I researched the reason why admin type account is required then I found this answer.
You can change target machine user account this way: Control Panel -> User Accounts -> Change Account Type. You must enter an admin account and password to change that account if you logged in standard account.
After that I logged in with this command:
psexec \\remotepcname -u remoteusername -p remotepassword cmd
尝试了上述所有建议,但仍然无法解决该错误。 最后,一旦我进行了以下更改,我就可以成功运行 PSexec 命令。
事实证明,当您启用 UAC 时,psexec 无法按预期工作。 我们需要将 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA 设置为 0,然后 psexec 开始按预期工作。
Tried all suggestions above, but still was unable to resolve the error. Finally once I made the below change, I could successfully run the PSexec command.
Turns out that when you have UAC enabled psexec does not work as supposed. We need to set
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
to 0 then psexec starts working as expected.这是问题的答案,
请确保您的系统执行策略已设置
使用
get-ExecutionPolicy
验证它,然后运行命令
winrm qc
命令和提示符y
就是这样。
Here is the answer of the issue
make sure your system execution policy is set
verify it using
get-ExecutionPolicy
after that just run the command
winrm qc
command and prompty
thats it.
您好,我在这里总结了许多在线来源的“访问被拒绝”的各种解决方案:
大多数信息可以在这里找到(包括所需的要求) - sysinternal 帮助
正如有人提到的添加此注册表项,然后重新启动计算机:
<块引用>
reg 添加 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system
/v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
阅读这篇知识库文章了解其作用及其原因是
需要
禁用防火墙(注意 - 这将使您没有任何防火墙
保护)
<块引用>
netsh advfirewall 将所有配置文件状态设置为关闭
如果目标用户有一个空白密码并且您不想添加一个,请在目标上运行:
<块引用>
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"LimitBlankPasswordUse"=dword:00000000
这对我不起作用,但我在一些地方读过它对其他人有用,
在目标上执行:
<块引用>
开始-> 运行-> secpol.msc-> 当地政策 -> 安全选项-> 网络访问:共享> 和本地帐户的安全模型> 经典 - 本地用户以自己的身份进行身份验证
如果已经处于“经典”状态:
<块引用>
移动到“仅限来宾 - ..”从提升的命令提示符 gpupdate \force 运行
移回“经典 - ..”,再次从提升的命令提示符 gpupdate \force 运行
这解决了我的问题:
<块引用>
从提升的命令提示符“net use”在目标上运行,查看输出图表以及远程列中列出的共享(我只删除了断开连接的共享 - 您可以全部尝试)运行“net use [之前列表中的远程路径” ] /delete”然后运行 'net use \target\Admin$ /user:[用户名]' 输入提示密码请求(如果空密码只需按 Enter 键),viola 应该可以工作。
Hi i am placing here a summary from many sources online for various solutions to "access is denied" :
most information can be found here (including requirements needed) - sysinternal help
as someone mentioned add this reg key, and then restart the computer :
Read this knowledge base article to learn what this does and why it is
needed
Disable firewall (note - this will leave you with out any firewall
protection)
if target user has a blank PW and you dont want to add one, run on target:
This didnt work for me, but i have read it did for others in a few places,
on target execute:
if already in 'Classic':
This one solved my issue:
我刚刚解决了相同的症状,方法是创建注册表值
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system\LocalAccountTokenFilterPolicy
并将其设置为 1。更多详细信息请参见此处。I just solved an identical symptom, by creating the registry value
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system\LocalAccountTokenFilterPolicy
and setting it to 1. More details are available here.这对我的情况有帮助:
This helped in my case:
PsExec 拥有其启动器拥有的任何访问权限。 它在常规 Windows 访问控制下运行。 这意味着启动 PsExec 的人(无论是您、调度程序、服务等)在目标计算机上没有足够的权限,或者目标计算机配置不正确。 首先要做的事情是:
如果这不能解决您的问题,请确保目标计算机满足最低要求,此处指定。
PsExec has whatever access rights its launcher has. It runs under regular Windows access control. This means whoever launched PsExec (be it either you, the scheduler, a service etc.) does not have sufficient rights on the target machine, or the target machine is not configured correctly. The first things to do are:
If this did not solve your problem, make sure the target machine meets the minimum requirements, specified here.
在使用 psexec 之前,您可以尝试使用命令
来获取远程 PC 上的管理员权限。
You can try the command
to get admin permissions on remote PC before use psexec.