// // Internal "constructor": Used for constructing UnknownPrincipal // static internal UnknownPrincipal CreateUnknownPrincipal(PrincipalContext ctx, byte[] sid, string name) { UnknownPrincipal up = new UnknownPrincipal(ctx); up.unpersisted = false; up.fakePrincipal = true; // Set the display name on the object up.LoadValueIntoProperty(PropertyNames.PrincipalDisplayName, name); // Set the display name on the object up.LoadValueIntoProperty(PropertyNames.PrincipalName, name); // SID IdentityClaim SecurityIdentifier sidObj = new SecurityIdentifier(Utils.ConvertSidToSDDL(sid)); // Set the display name on the object up.LoadValueIntoProperty(PropertyNames.PrincipalSid, sidObj); return up; }
// // Internal "constructor": Used for constructing UnknownPrincipal // static internal UnknownPrincipal CreateUnknownPrincipal(PrincipalContext ctx, byte[] sid, string name) { UnknownPrincipal up = new UnknownPrincipal(ctx); up.unpersisted = false; up.fakePrincipal = true; // Set the display name on the object up.LoadValueIntoProperty(PropertyNames.PrincipalDisplayName, name); // Set the display name on the object up.LoadValueIntoProperty(PropertyNames.PrincipalName, name); // SID IdentityClaim SecurityIdentifier sidObj = new SecurityIdentifier(Utils.ConvertSidToSDDL(sid)); // Set the display name on the object up.LoadValueIntoProperty(PropertyNames.PrincipalSid, sidObj); return(up); }