internal string GetSddlForm() { string sidString = Value; WellKnownAccount acct = WellKnownAccount.LookupBySid(sidString); if (acct == null || acct.SddlForm == null) { return(sidString); } return(acct.SddlForm); }
internal string GetSddlForm() { string result = ToString(); WellKnownAccount acct = WellKnownAccount.LookupBySid(result); if (acct != null && acct.SddlForm != null) { result = acct.SddlForm; } return(result); }
public override IdentityReference Translate(Type targetType) { if (targetType == typeof(SecurityIdentifier)) { return(this); } if (targetType == typeof(NTAccount)) { WellKnownAccount acct = WellKnownAccount.LookupBySid(this.Value); if (acct == null || acct.Name == null) { throw new IdentityNotMappedException("Unable to map SID: " + this.Value); } return(new NTAccount(acct.Name)); } throw new ArgumentException("Unknown type.", "targetType"); }