Nagpur Cha SysAdmin is a blog about tips, tricks, free PowerShell scripts, free tools and easy solutions for various day to day and advance tasks of system administrators.

Search This Blog

Friday 22 September 2017

Solved : Error establishing communication with PsExec service on Remote computer

Hi All,
 I ran in to an issue while trying to start a Service on remote server by using the PsExec command

While running the below command
PsExec \\192.168.100.1 -u username -p password net start "Sample service"

This was failing with below error. I tried to execute this from command prompt of 192.168.100.2 and getting the error

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

I have browsed the internet for the above error but none of the answers on Internet had helped me.

Then the solution came in below way …

During investigation I have found that the 192.168.100.1 server was already having PSEXESVC service in place on server which logically should not be there as the PSexec command will each time try to create this PSEXESVC  service for temporary purpose only, which gets removed after each execution. As a result whenever the PSexec was trying to create temporary PSEXESVC service it was receiving exception that the service already exist. Now we have taken care of it and everything seems to be working fine.

Steps to be performed to resolve the issue:

1.       Make sure PSexec exe is present on server
2.       Go to Services.msc and check if service PSEXESVC exist on remote server
3.       If service exist, please stop the service and remove its .exe file as well
4.       You can get .exe file details from service properties tab
5.       Now try to execute your desired command, it should run properly now.

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.


Apart from the above solution you can always use the below alternative method which works perfect.

SC \\192.168.100.1 start " Sample service "
SC \\192.168.100.1 stop " Sample service "

Kindly Share your experience in comment section with my blog/post if it did help you !!

Stay Blessed!!  
Thank You!!

1 comment:

  1. So happy we found this post. It helped tremendously! It was exactly the issue we had and provided helpful steps to resolve the problem.

    ReplyDelete

Comments system