title: Windows - remotely running executable or cmd using WMI or powershell, and logging the output
body: <p>This is incredibly difficult to do. I can't believe it. It should be so easy.</p>
  
  <p>Anyway, using WMI (with both vbscript and perl) I'm able to start a process on a remote machine that runs a .exe, but I cannot get the output to write to a log. This is driving me nuts. I have to use WMI or powershell because I can't install anything additional on the remote machines, which are all Windows 2003 or newer. I also cannot assume that powershell remoting is enabled on all target machines, so I may not even be able to use powershell. This can cause a problem with powershell.</p>
  
  <p>Here is what I'm trying to do in psuedo code:</p>
  
  <p>servers = server1, server2, server3</p>
  
  <p>for each server in servers</p>
  
  <p>run command on remote server >> log.txt</p>
  
  <p>next</p>