Run a process on another network PC as the logged in user

-1

In a controlled network environment, we plan to put automated testing applications on some workstations - they interact with our GUI-based software running on those PCs.

I want to be able to launch these processes from another PC on the network, as simply as possible (i.e. not mucking about with COM!) Is this possible somehow, to remotely run an .EXE? Since the process involves GUI, I think it has to run as the logged-on user?

If it matters, workstations are on Windows 7.

Mr. Boy

Posted 2015-02-11T12:22:42.077

Reputation: 3 710

Question was closed 2015-02-11T13:56:18.750

Answers

0

The probably most common tool would be SSH I guess. There are SSH daemons for Windows as well.

If you'd like to use board tools, I guess PowerShell might be an option.

I haven't tried it myself, but according to this article it's pretty straightforward:

  • Run a PowerShell instance on the remote machine with admin privileges and execute Enable-PsRemoting -Force to enable remote access.

  • Connect to the remote machine open a PowerShell and execute Enter-PsSession -ComputerName COMPUTER -credential USERNAME.

  • To simply run a command on the remote machine, open a PowerShell and use Invoke-Command -ComputerName COMPUTER -ScriptBlock { COMMAND } -credential USERNAME.

Also programs don't have to run as the active user of the remote machine. Depending on security settings you might require an elevated account though.

Mario

Posted 2015-02-11T12:22:42.077

Reputation: 3 685

Having to run something on the target machine the whole time, listening, isn't really ideal. Is that just the way things have to work, though? – Mr. Boy – 2015-02-11T12:35:23.820

@Mr.Boy Couldn't think of any other way around that, unless the remote machine regularly looks for some file on a web server for example and executes its contents (like some trojans). – Mario – 2015-02-11T12:36:39.877

I came across PsExec (https://technet.microsoft.com/en-gb/sysinternals/bb897553.aspx) but I cannot tell if this will let me run a process on an already logged in PC...

– Mr. Boy – 2015-02-11T12:39:55.623

@Mario PsExec will work, but likely run the process as SYSTEM. But it doesn't really matter. Just try and see if it works. – LPChip – 2015-02-11T12:41:42.453

Sounds promising and interesting. Haven't tried it myself so far. @LPChip You're obviously able to pass a username and password, but not sure those are just for authentication purposes. – Mario – 2015-02-11T12:43:55.167

@LPChip if you've got experience using this would you consider writing up a full answer? – Mr. Boy – 2015-02-11T12:46:15.050

@Mr. Boy I used it many years ago. Not enough to write an answer, but I know that it was pretty easy to test, so it should be for you to test it too. – LPChip – 2015-02-11T15:30:40.887