I have a folder on a shared server that folder has many files. I need to retrieve information about the Files Author Name (The name of the user who created or last updated he file in the folder).
I tried some code samples available on web but it gives the domain and the computer name but not the actual user/author name.
I tried below:
const string FILE = @"C:\temp\temp.txt";
var fs = File.GetAccessControl(FILE);
var sid = fs.GetOwner(typeof(SecurityIdentifier));
Console.WriteLine(sid); // SID
var ntAccount = sid.Translate(typeof(NTAccount));
var STRING = ntAccount.Value;
Console.Write(ntAccount); // DOMAIN\username
but it only gives DOMAIN\computer name.