using System;
using System.Management;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
RunRemote("my_machine_name.domain.tld","NTNET","Administrator","my_pass","notepad.exe");
}
static void RunRemote(string host, string realm, string user, string pass, string program)
{
var processToRun = new[] { program };
var connection = new ConnectionOptions();
connection.Username = realm + "\\" + user;
connection.Password = pass;
var wmiScope = new ManagementScope(String.Format("\\\\{0}\\root\\cimv2", host), connection);
var wmiProcess = new ManagementClass(wmiScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
wmiProcess.InvokeMethod("Create", processToRun);
}
}
}