static string GetSidForUser(string username) { var account = new NTAccount(username); var sid = (SecurityIdentifier) account.Translate(typeof(SecurityIdentifier)); return sid.ToString(); }