using System.Security.Principal; ... string userName = Environment.MachineName + @"\Administrator"; NTAccount account= new NTAccount(userName); SecurityIdentifier sid = (SecurityIdentifier)
account.Translate(typeof(SecurityIdentifier)); string machineSid = sid.AccountDomainSid.ToString();
No comments:
Post a Comment