Prova questo:
using System;
using System.Runtime.InteropServices;
namespace shutdown
{
class Program
{
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool InitiateSystemShutdown(
string lpMachineName,
string lpMessage,
uint dwTimeout,
bool bForceAppsClosed,
bool bRebootAfterShutdown);
static void Main(string[] args)
{
Console.WriteLine("Premere un tasto per spegnere il pc...");
Console.Read();
InitiateSystemShutdown(@"\\127.0.0.1", "Shutdown...", 30, true, false);
}
}
}