PsExec: Access is denied

1

I am trying to run a VBS script on many PC on my network at the same time. I am admin on all of them, but the instruction needs to run under SYSTEM account. I have opted to use PsExec (v.2.11) from Systernals. The problem I am having is that I keep getting the dreaded “Access is denied” message.

Just to keep it simple in this post, my VBS script is msgbox “TEST” For debugging purposes I have added the cmd /k command and argument to see the message. Finally, I have the code in a shared folder.

PsExec \\TargetPC -s -i -h cmd /k cscript "\\SharedFolder\temp\PSTools\test.vbs"

This is what I have tried:

  • I have tried to add the following key to the registry: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] "LocalAccountTokenFilterPolicy"=dword:00000001

  • I removed the Security Update KB2893294 on the target PC, but still doesn’t work. I have even tried using the –u argument with my
    user and password, but the same.

  • I can run the command net use \\TargetPC /user:myUser fine.

  • Firewall is off.

Rick

Posted 2015-07-22T12:22:19.553

Reputation: 419

Answers

0

Without starting PSEXEC with explicit username and password, it will not have network access.

You can either first copy the vbs to the remote host or use a batch file to construct the vbs at runtime on the remote host. With such a batch file you can use -f -c options with the batch file to copy and run command remotely.

Shaun Vermaak

Posted 2015-07-22T12:22:19.553

Reputation: 311

See your point on which you mentioned that you tried it with -u and -p. Was that still with the -s? – Shaun Vermaak – 2015-07-22T14:33:45.423