title: kill com process on remote machine, determinate process startup arguments
body: <p>I want to kill com process on remote computer.</p>
  
  <p>I tried taskkill but I cannot find how to det pid from com guid or startup arguments.</p>
  
  <p>Then I tried following:</p>
  
  <pre><code>ConnectionOptions connectoptions = new ConnectionOptions();
  connectoptions.Username = @"YourDomainName\UserName";
  connectoptions.Password = "Password";
  
  ManagementScope scope = new ManagementScope(@"\\" + remoteComp + @"\root\cimv2", connectoptions);
  
  //Define the WMI query to be executed on the remote machine
  SelectQuery query = new SelectQuery("select * from Win32_process where name = 'dllhost.exe' and CommandLine LIKE '%COMGUID%'");
  
  using (ManagementObjectSearcher searcher = new
                     ManagementObjectSearcher(scope, query))
  {
      foreach (ManagementObject process in searcher.Get())
      {
  
          process.InvokeMethod("Terminate", null);
  
      }
  }
  </code></pre>
  
  <p>For some reason I cannot execute it because of RPC error (firewall is turned off)</p>
  
  <p>I put it in own Webservice but I got "User credentials cannot be used for local connections"</p>
  
  <p>I removed ConnectionOptions but I still cannot execute it because I get CommandLine is always null and I cannot determinate right dllhost.exe instance.</p>
  
  <p>I used Process class int the webservice but sturtupinfo arguments are always empty.</p>
  
  <p>How to get stutup arguments for different process or if any way to kill the process.</p>