Start process from System Account with a specific User Name
- by pavel.tuzov
Hi,
I'm developing a windows service in C# .net, Account: LocalSystem
I want this service to check for all currently logged users if a specific application is running and if not - start this application AS corresponding user name.
I provide domain, name, password, but Start() throws Win32Exception exception "Access is denied"
process.StartInfo.Domain = domain;
process.StartInfo.UserName = name;
process.StartInfo.Password = password;
process.StartInfo.FileName = fileName;
process.StartInfo.UseShellExecute = false;
process.Start();
The user whose credentials I provide is in administrator group - the application successfully runs if started manually.
Is this accomplished in a different way?
Thank you!