Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PSEXEC Fails to run locally: Error establishing communication with PsExec service

Tags:

psexec

I only have this issue on a single Windows 8.1 machine in my domain when running PSEXEC locally. Before my domain password expired and was changed, running PSEXEC locally with this command worked.

\\fs\storage\QA\Mason\psexec\PSExec.exe \\support02 /accepteula -u build -p password -e -s \\fs\storage\QA\Mason\psexec\Cambria_RI.bat

Now, it produces this error:

Error establishing communication with PsExec service on SUPPORT02: The system cannot find the file specified.

EDIT1: It seems that running PSEXEC locally, with a local target (.bat) file fixes this issue. Why suddenly am I restricted to only using local files?

EDIT2: Executing the same command as above but with a different target machine machine will also work.

like image 901
MGItkin Avatar asked Jul 28 '15 17:07

MGItkin


People also ask

How do I start PsExec services on a remote computer?

PsExec allows you to run the command simultaneously on multiple remote computers. To do this, you can set the computer names separated by commas: psexec PC1,PC2 “ipconfig /all” or save them in a text file, and then specify a path to this file: psexec @c:\ps\computer_list.

What is PsExec service?

PsExec is a light-weight telnet-replacement that lets you execute processes on other systems, complete with full interactivity for console applications, without having to manually install client software.

Do I need to install PsExec?

Technically, you don't install PsExec since it's just a command-line utility but close enough. Since no installation is necessary, you simply need to download and extract it from the PsTools zip file. PsExec isn't available as a standalone utility and is part of the PsTools suite of tools.


1 Answers

One known solution for this exact error is to kill any rogue psexecsvc.exe process on the target machine. While this works for remote callers, I suspect it may resolve local issues as well.

If the psexecsvc.exe is hanging around after using psexec, something is likely going wrong like an application crash or simultaneous remote executions with mismatching versions.

A couple things to look at are;

  • Clean out older instances of psexecsvc.
  • Ensure you have the latest version of the pstools.
  • Ensure you are using the same versions of psexec on all your machines.
  • Use process of elimination to figure out what events are leaving the psexecsvc process running. The psexecsvc.exe should automatically exit and remove itself from %windir% where it is temporarily placed during execution.

Cleaning out rogue copies:

  • Check the %windir% directory and make sure you don't have a rogue one in there.
  • In some reported cases, the psexecsvc is being wrongly copied into the %%windir%\system32 directory. If this is the case and it continues to happen, look into your environment variables, user profiles and credentials. The path is based on "Admin$" and should be %windir%.

Workarounds if all else fails:

  • Figure out a way to kill the psexecsvc.exe process as part of cleanup.
like image 166
GrayDwarf Avatar answered Sep 23 '22 19:09

GrayDwarf