I have developed a ASP.NET C# web page which connects to remote conmputer command prompt using PSEXEC.exe and executes some command where the output of the command will get copied to the page. It works fine in the VS 2005 IDE.
If the page is accessed via IIS from IE, the task PSEXEC.EXE appears in task manager of the server with the system account privilege after the method is triggered but nothing happens.
Please find my present settings in IIS and others:
1. APP Pool Identity to Local System (Predefined) and also to a configurable admin account.
2. <processModel userName="SYSTEM" password="AutoGenerate" /> in Machine.Config file
Also I've tried impersonasation in web.config file to an admin account. I am not able to sort this problem, please help.
I've tried a lot spending more time.
Code Is:Process p = new Process();
string result = "";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = @"C:\psexec.exe";
p.StartInfo.Arguments = @"\\nawrkxp613 -u domain\usename -p Password1 cmd.exe /c ipconfig";
StreamReader stdOut = p.StandardOutput;
result = stdOut.R
View Complete Post