I am trying to get a DomainName\UserName associated with a Process in a C# application. All the other data I need to collect about a application I can access via the Process.GetProcessesById() method. The object returned also contains a property for the DomainName and UserName however this always seems to be an empty string when getting an existing process.
I know I can also get this information by querying the WMI object for the user name, however is there anyway to get this by simply doing the following?
Process.GetProcessById(1234).StartInfo.UserName