I would like to start the process from the intranet client on the WCF service side. In my case, the client asks the server to create a new process on the server in accordance with the credentials provided. WCF service is hosted on IIS 7.5 and I am starting the process using this code
var processInfo = new ProcessStartInfo("C:\\Windows\\System32\\notepad.exe") { UserName = "some user", Password = MakeSecureString("some password"), UseShellExecute = false, LoadUserProfile = true }; Process process = Process.Start(processInfo);
This code works if I host the WCF service as a standalone console application under the administratorβs control, and I see that notepad runs under a different user. It does not work in IIS without exception, but the process ends immediately
process.HasExited = true; process.ExitCode = -1073741502;
In an IIS application, WCF runs as a user with administrator privileges and has full trust defined in web.config. I cannot use a self-service application because it does not support easy continuous delivery (for example, WebDeploy with IIS web farms).
Q: How to start a server-side process from a WCF service hosted in IIS?
EDIT:
I came across this post with similar problems and I tried all the methods there, including all the possible options for Process.Start and P / Invoke with CreateProcessWithLogonW and CreateProcessAsUser. I also tried to provide additional permissions to users. Non of this will work with error messages identical to those sent by the guy.
c # iis hosting wcf
oleksii
source share