0

I use File.GetAccessControl(ProcessName).GetOwner(typeof(SecurityIdentifier)).Translate(typeof(NTAccount)).tostring();
to get the owner of a process running in the task manager but it returns "Builtin\Administrators" while the process I queried was an installed program's running instance that is runnable without an administrative privilege. Why is that ? Besides, I expect a better string returned i.e "System" or "Local network service" instead of fake Builtin\Administrators. I tested this method with all other processes and I'm surprised to find only my opening notepad instance is supposed to be of my computer's username.

1 Answers1

1

I believe you are querying the file itself not the running process. You'll need to do something like this How do I get the SID / session of an arbitrary process?

Community
  • 1
  • 1
kmcc049
  • 2,783
  • 17
  • 13