I have several slave machines and a master machine which together run a distributed application. Processes on each slave machine have to have a GUI and network access (I think it would be called an interactive process then). For ease of use it would be nice if the master machine could start/stop the processes on those slave machines.
My first idea was to use WMI and the Win32_Process class to start a remote process but upon further investigation it was reveiled that processes started this way are non-interactive and isolated, and thus cannot have any GUI. A note says that one can use Win32_ScheduledJob.Create to create a remote interactive process, but it runs under the LocalSystem account which I would like to avoid (also I couldn't even get it to run properly).
What would be good ways to solve this problem? Maybe it is possible to launch a helper application which in turn starts a proper process, but that seems quite dirty.
Edit: PsExec was really clunky when I tried it and slow as hell (not sure why). Looking further at PsExec it seems it installs a temporary service on the remote machine to launch the application. Would this be the only way to spawn an interactive process using a proper identity? Should I include a helper service in the setup for the nodes? But even then, how would I communicate with it then?
MPICH2 is often used in High Performance Computing clusters and should be able to do what you want. Even if you don't use it for passing the messages between machines, you can use its process launcher to start all of the processes up from the master machine. It can be set up to authenticate as a particular Windows user on the machines.
The following two post use .NET to execute remote processes.
Using WMI
http://weblogs.asp.net/steveschofield/archive/2006/06/06/WMI---start-a-process-on-remote-machine-passing-credentials_2E00_.aspx
Codeproject Example
http://www.codeproject.com/KB/IP/RemotingExec.aspx
The examples execute with custom credentials & the remote executable is a Win Form app. Hope this helps.