3

Is there a way to run remote commands in a windows system just like you can in Linux using the "ssh -c" command.

Thanks!

Autobyte

Autobyte
  • 171
  • 3
  • 8

7 Answers7

7

PSTools PSExec can do exactly that! :)

http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx

northirid
  • 240
  • 2
  • 5
  • Does it have to be installed on each system that needs to be controlled or just the main server? Also this only runs on a windows box right? -- I guess this could work.. – Autobyte May 01 '10 at 03:36
  • Just on the system you're using it from. And yes, win only. – northirid May 01 '10 at 04:56
2

You can uses powershell remoting. Psexec often gets blocked by antivirus. Powershell remoting would be the most reliable way of performing remote commands.

Jim B
  • 23,938
  • 4
  • 35
  • 58
1

I have Cygwin installed on most of my Windows machines. With it's OpenSSH port you can use ssh just as your can to any Linux/BSD/other machine.

If you don't want anything else that Cygwin offers copssh seems a popular alternative - it is basically just the OpenSSH port and its dependences extracted from Cygwin.

The pstools set (already mentioned by northirid in an earlier answer) are easier to setup if windows->windows is all you need but actually having a SSH service is very handy if you need a little more.

David Spillett
  • 22,534
  • 42
  • 66
0

AT command is another way.

K. Brian Kelley
  • 9,004
  • 31
  • 33
0

The beauty of PSexec is that it executes and if required, copies the files to run on the destination system and can use any credentials

user44304
  • 41
  • 3
0

From Unix / Linux, you have :

0

winrs (https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/winrs), does what you need. It is a built-in command so you don't need anything extra. But first you need to run 'winrm quickconfig' on the remote machine (just once) for it to work.

alid
  • 1