static void RebootServer(string computerId) { using (ITerminalServer server = manager.GetRemoteServer(computerId)) { server.Open(); server.Shutdown(ShutdownType.Reboot); } }
private static void Shutdown(string[] args) { if (args.Length < 3) { Console.WriteLine("Usage: SessionInfo shutdown [server] [shutdown type]"); return; } using (ITerminalServer server = GetServerFromName(args[1])) { server.Open(); ShutdownType type = (ShutdownType)Enum.Parse(typeof(ShutdownType), args[2], true); server.Shutdown(type); } }