0

hey guys

just wondering how can i run process/kill process on remote machine using C# , I have found some solutions using PsExec but it didn't work.

or just something that will give me access to remote pc to its CMD

thanks.

Alex KO
  • 21
  • 3

2 Answers2

1

Could you try WMI.NET

SO Thread

Community
  • 1
  • 1
Anand
  • 14,545
  • 8
  • 32
  • 44
  • 1. Windows 7 2. The code didnt work, it didnt connect to the remote pc but when i gave it the local machine name it ran the process i wanted to. – Alex KO Aug 28 '13 at 09:00
  • You probably need to open some ports on the remote machine or in a firewall between them. DCOM is a nightmare to get working across firewalls... – Erik A. Brandstadmoen Aug 28 '13 at 09:06
  • Do not use the SO thread code directly. If I were you, I would read the MSDN link and then try to understand it fully. In documentations, its not written WMI is not supported by windows 7.2, so I suppose this would work. This was just a pointer. It's not an area where will get pre baked answer. – Anand Aug 28 '13 at 09:06
0

PsExec or remote PowerShell are two solutions if you really need to do this. There is no 'magic' way of executing commands on other machines. If PsExec does not work for you, I suggest creating a service (WCF of Windows Service) on the remote machine, and send commands to that service, then execute them locally on the remote machine.

Erik A. Brandstadmoen
  • 10,430
  • 2
  • 37
  • 55