To Execute the Remote Machine Process Example To reset the iis of remote machine
ProcessStartInfo psi = new ProcessStartInfo("iisreset.exe", "RematoreMachineName -stop");
psi.UserName = "RemoteMachineUserName";
psi.Domain = "DomainNameOfRemoteMachine";
psi.UseShellExecute = false;
string password = "RemoteMachinePassword";
System.Security.SecureString o = new System.Security.SecureString();
foreach (char c in password)
{
o.AppendChar(c);
}
psi.Password = o;
Process.Start(psi);
No comments:
Post a Comment