How can you remotely start a process on Windows as a different user?

5,423

Solution 1

PSexec will do what you want. It dosent need to be installed to use it.

As for security in PSexec, if the account you are using to execute PSexec on your machine has the right privelidges on the remote machine, then you dont need to enter a username and password with the PSexec command, and no credentials are sent in clear text 'over the wire' to the remote machine.

However if you have to incude username and password with the PSexec command then they will be sent in clear text to the remote machine.

Solution 2

My preference is to use psexec but I don't recall if the traffic is encrypted or not.

Solution 3

Did you looked at psexec ?

Share:
5,423

Related videos on Youtube

Jeff Hutton
Author by

Jeff Hutton

Updated on September 17, 2022

Comments

  • Jeff Hutton
    Jeff Hutton almost 2 years

    We have a Windows environment comprising XP SP3 workstations, some Vista Workstations, and Windows 2003 Server. I have need to start a process remotely on some of these systems from the command line (a script). The ID starting the process and the ID that will run the process are both members of the remote machine's Local Admin group and are not necessarily the same user. Policy prevents adding 3rd party software such as WinSSH, Cygwin, or others. Exceptions to the policy may be granted with great effort, but I am lazy.

    I would like the ability to start a process remotely as a different (or the same) user as I can with SSH on UNIX variants. The closest I can come is using schtasks to remotely create/run/delete a task that accomplishes what I need. This is combersome and I have concern over password protection as the command traverses the network. Does Windows somehow encrypt the traffic when you issue: schtasks /create /tn /tr /ru /rp /sc once /st ?.

    Is there a better way?

    Is there a better way that doesn't require oceans of cscript?

  • Srinivasan MK
    Srinivasan MK almost 15 years
    I will add that this sounds like you would be doing this on an internal network. If that is the case and as long as your network is properly firewalled from the rest of the net, then I don't see the need to worry about the encryption. If your own people are sniffing your traffic and stealing passwords, then I would say you are solving the wrong problem.
  • Jeff Hutton
    Jeff Hutton almost 15 years
    Thanks. It turns out that the folks that create the server instances include some of the PSTOOLs untilities by default, including psexec. psexec should do nicely.