Here's my problem.
I have an NT service (really a .NET service) running as local system.
I have a .NET form running on the user account. The form and the
service communicate via an IPC Channel so the form can control the
service and do various things. Both applications share the same set
of dlls.
When performing an update of some of the dlls, both the service and
the form must be shut down (that's just how it's implemented -- didn't
want to deal with unloading app domains). The update is performed by
a separate program that is run by the service, so the update process
is also running under Local System. Since the update process shuts
down the form process, I want it to restart the form process when the
update completes. The problem is that the form process restarts as
Local System. I want it to be under the user account that originally
started it.
There is a .NET method to start a process as another user --
Process.Start() with a ProcessStartInfo structure that specifies the
username and password of the user account. However, that cannot work
because I can't specify the password. So I've resorted to getting the
user handle via Interop and running StartProcessAsUser giving it the
user handle acquired from OpenProcessToken. I get Access Denied.
Any other ways to launch user process from local system without having
the password?