List of processes running on Remote/Local Computer using C#

ArrayList alist = new ArrayList();

// From remote machine
Process[] processes = Process.GetProcesses("RemoteComputerName");
foreach (Process process in processes)
{
     alist.Add(process.ProcessName);
}
 
 
// From local machine
Process[] processess = Process.GetProcesses();

foreach (Process process in processess)
{
    alist.Add(process.ProcessName);
}