Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed - Psexec and PSEXESVC service
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Psexec and PSEXESVC service

 Post Reply Post Reply
Author
Message
bildos View Drop Down
Newbie
Newbie


Joined: 28 December 2005
Location: Poland
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote bildos Quote  Post ReplyReply Direct Link To This Post Topic: Psexec and PSEXESVC service
    Posted: 22 January 2007 at 11:21am
Hello,
I'm useing psexec, but after use that tool at remote system this software install PSEXESVC service. How can I prevent remote system against installation of this service ?
I just want to use psexec without installation PSEXESVC service.
Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5126
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 22 January 2007 at 1:12pm
Hi, bildos.

You can't. See explanation below.

How psexec works:

Sample command:
psexec \\target -u adminuser -p passw some_executable

psexec connects to \\target and authenticates as adminuser.
If this does not work, psexec will show an error message and exit.
Next psexec copies psexesvc.exe to \\target\Admin$ and launches it as a temporary service.
If this does not work, psexec will show an error message and exit.
psexesvc on \\target launches some_executable.
psexec and psexesvc use pipes to handle keyboard input and screen output.
Once some_executable finishes, psexesvc will terminate, too, and remove itself from the services list.
psexec will exit.
(If you use psexec's -d option things work slightly differently, but the result will be the same.)

Summary
There is no way of using psexec to execute a command remotely without having the temporary service psexesvc. But psexesvc will disappear when no longer needed.

Karl
Back to Top
bildos View Drop Down
Newbie
Newbie


Joined: 28 December 2005
Location: Poland
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote bildos Quote  Post ReplyReply Direct Link To This Post Posted: 23 January 2007 at 12:00pm
So after disconected psexesvc should be autmatiocal remocved from remote host ?
Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5126
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 23 January 2007 at 2:52pm
Correct.

In the rare case that this should not happen, then
  • from the local machine try to stop and remove it using
    sc.exe \\target stop psexesvc
    
    sc.exe \\target delete psexesvc
  • or logon to the target machine and launch
    sc.exe stop psexesvc
    
    sc.exe delete psexesvc

Karl

Edited by Karlchen - 23 January 2007 at 3:01pm
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down