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