K
Kurtis Carlson
I’m writing a web page that allows users to reset their own Terminal Services
session. The app needs to execute a program in the background (on the web
server) and queries sessions on another server. The program is running on an
Intranet so, please, no comments about executing programs from a web page.
Here’s a code snippet:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "qwinsta.exe";
p.StartInfo.Arguments = " joeuser /server:myremoteserver";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
This code works fine from a command line program running under my domain
account. I’m getting Access Denied errors when running from the web page.
I’ve tried unsuccessfully tweaking some of the impersonation settings in the
web.config file.
What do I need to do to make this run under the right credentials?
Thanks in advance.
session. The app needs to execute a program in the background (on the web
server) and queries sessions on another server. The program is running on an
Intranet so, please, no comments about executing programs from a web page.
Here’s a code snippet:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "qwinsta.exe";
p.StartInfo.Arguments = " joeuser /server:myremoteserver";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
This code works fine from a command line program running under my domain
account. I’m getting Access Denied errors when running from the web page.
I’ve tried unsuccessfully tweaking some of the impersonation settings in the
web.config file.
What do I need to do to make this run under the right credentials?
Thanks in advance.