kemaltolga
Member
- Joined
- Nov 10, 2008
- Messages
- 1
I am working on a web interface to let users manage their own quotas. Everyting seems to work ok, except for user impersonations. Ather executables, like notepad, run just fine with my code, which is the C# version of *Runas...". But for dirquota I always get "The requested operation requires elevation".
Here is my code...
String DirQuota = ConfigurationManager.AppSettings["DirQuotaPath"];
String sArgument1 = " template list /remote:\"" + _servername + "\"";
System.Security.SecureString password = new System.Security.SecureString();
foreach (char c in sPassword)
{
password.AppendChar(c);
}
ProcessStartInfo startInfo = new ProcessStartInfo(DirQuota, sArgument1);
if (this.chkRunAsLocal.Checked == false)
{
startInfo.Domain = "xxx";
startInfo.UserName = sUserName;
startInfo.Password = password;
}
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
Process proc = new Process();
proc.StartInfo = startInfo;
proc.Start();
any ideas?
thanks
--tolga
Here is my code...
String DirQuota = ConfigurationManager.AppSettings["DirQuotaPath"];
String sArgument1 = " template list /remote:\"" + _servername + "\"";
System.Security.SecureString password = new System.Security.SecureString();
foreach (char c in sPassword)
{
password.AppendChar(c);
}
ProcessStartInfo startInfo = new ProcessStartInfo(DirQuota, sArgument1);
if (this.chkRunAsLocal.Checked == false)
{
startInfo.Domain = "xxx";
startInfo.UserName = sUserName;
startInfo.Password = password;
}
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
Process proc = new Process();
proc.StartInfo = startInfo;
proc.Start();
any ideas?
thanks
--tolga