Error communicating with PsExec service on PC0236206

Sujith Kinayath 1 Reputation point
2020-12-09T05:03:00.723+00:00

For the first time, I could able to run the application remotely using PsExec utility tool.
A day after, the same application could not able to run remotely using PsExec Utility tool.

Then i tried to get some answers and followed few steps

  1. sc.exe stop PSEXESVC
  2. Remove-Item –path 'C:\Windows\PSEXESVC.exe'
  3. Remove-Item -Path hklm:\SYSTEM\CurrentControlSet\Services\PSEXESVC -Confirm:$false

But still unsuccessful.

The error message is
psexec -i 2 \PC0236xxx -u xxxxxxx -p yyyyyyyyyy cmd /c C:\users\Desktop\SiemensProto\tia\tiaportal.py

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

Error communicating with PsExec service on PC0236xxx:
No process is on the other end of the pipe.

Can you please help me in overcome this issue.

Sysinternals
Sysinternals
Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,093 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. mariora 376 Reputation points
    2020-12-30T09:59:14.317+00:00

    -i 2 means you explicitly want to communicate as system on the Session number 2.
    So the first question is: are you sure that session is still available??
    Windows terminate and reuse session numbers as it want, so there is no guarantee that the same session number is still up running after one day.

    Go to the remote machine and start Process Explorer to enumerate the sessions and look for the number 2.

    There is also another parameter for psexec that make you choose the process name used on the remote machine, so you don't have to be sure the remote service has been really deleted.
    -r Specifies the name of the remote service to create or interact.
    with.

    So you can try using the -r parameter with a random generated name by you.. and better you can check the remote sessions available before trying to connect using the qwinsta command:
    qwinsta /server:servername

    will return the remote running sessions like it does locally
    qwinsta
    SESSIONNAME USERNAME ID STATE TYPE DEVICE
    services 0 Disc

    console Administrator 1 Active

    rdp-tcp 65536 Listen

    Bottom line, call qwinsta to be sure the session you want interact with is still up and running , randomize the name of the remote PSEXECSVC..

    HTH
    -mario

    1 person found this answer helpful.
    0 comments No comments