title: How do I find out what user owns what process programmatically?
body: <p>Okay, so what I'm attempting to do is find out the name of the user for which a given process belongs to.</p>
  
  <pre><code>        Process[] processList = Process.GetProcesses();
          foreach (Process p in processList)
          {
              Console.WriteLine(p.Id);
  
          }
          Console.ReadLine();
  </code></pre>
  
  <p>Currently, I can find out the process ID of each process, but not the user. Is there a way to tell who the user is that owns the process if I know the process ID? </p>