I want to iisreset a remote machine from my local using c#. iisreset /start is working from command prompt but when i am using the same script from c# code it is not working. Anyhelp would be really appreciated. Here is the code attached:
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new
System.Diagnostics.ProcessStartInfo();
//startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/c iisreset <servername> /start";
process.StartInfo = startInfo;
process.Start();