title: Execute C# code on remote machine
body: <p>i have a piece of code which i want to execute on remote computer. I am not getting how to do that. Like if i want to execute command given below on remote machine how to do that.</p>
  
  <pre><code> Process[] processlist = Process.GetProcesses();
  </code></pre>
  
  <p>it is just an example, like i want to execute whole code on remote machine with libraries.</p>
  
  <p>if you are going to answer for getting processlist as</p>
  
  <pre><code>SelectQuery selectQuery = new SelectQuery("Select * from Win32_Process");
  using(ManagementObjectSearcher searcher =new ManagementObjectSearcher(manScope, selectQuery))
  </code></pre>
  
  <p>i already know that , please save it. is there any way to execute whole code after connecting to scope.</p>