PrincipalContext class namespace c# code example
Example: PrincipalContext c# example
PrincipalContext ctx = new PrincipalContext(contextType, domainname, username,password);
UserPrincipal user = UserPrincipal.FindByIdentity(ctx, userName);