I have a situation occuring when launching Processes from a Windows service
_________
| | * Process 1
| Service | -------> * Process ...
|_________| * Process n
The code used by the service to do so is the following:
ProcessStartInfo startInfo = new ProcessStartInfo(executablePath, commandlineArgs);
startInfo.WorkingDirectory = instancePath;
startInfo.UserName = userB;
startInfo.Password = passwordSecureString;
startInfo.Domain = domain;
startInfo.UseShellExecute = false;
Process process = new Process
{
StartInfo = startInfo,
EnableRaisingEvents = true,
};
process.Start();
Now, I have two accounts - for simplicity's sake, say A and B. The service is being run under the first one and starts the processes using the second one.
- Both accounts are in the Local Admin group
- Both accounts have the right to log on as a service
- Secondary logon service is enabled (just in case, should that matter)
- OS: Windows Server 2012 R2.
The following table is supposed to indicate what happens in which account constellation.
_______________
| | A | B |
|===+=====+=====|
| A | OK | X |
|---+-----+-----|
| B | X | OK |
|___|_____|_____|
- OK - Processes start as expected
- X - The service gets no error, but processes terminate right away.
...which makes me assume that the user change leads to the problem.
Details on the occuring exception:
After having read upon Error Code 142, here's what I've tried so far:
- Different Server
- Windows Updates
- Redistributable c++ installation
- coffee, followed by strong liquor, then again coffee
Can anyone relate to this issue?