User430178104 posted
Hi,
I was using below code to change password for windows account. This code is working in localhost and not in IIS.
I noticed in IIS, when i changed the DefaultAppPool identity to LocalSystem it is working. But, My app pool identity is ApplicationPoolIdentity. it is not working
Process QProc = new Process();
// Do Something To hide Command(cmd) Window
QProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
QProc.StartInfo.CreateNoWindow = true;
// Call Net.exe
QProc.StartInfo.WorkingDirectory = "C:\\windows\\SYSTEM32";
//QProc.StartInfo.WorkingDirectory = filePath;
QProc.StartInfo.FileName = "net.exe";
QProc.StartInfo.UseShellExecute = false;
QProc.StartInfo.RedirectStandardError = true;
QProc.StartInfo.RedirectStandardInput = true;
QProc.StartInfo.RedirectStandardOutput = true;
// Prepare Command for Exec
QProc.StartInfo.Arguments = @" user " + txtUserName.Text + " " + txtPassword.Text;
QProc.Start();