2

I need to set a user password in Active Directory using LDAP Delphi component from IPWorks.

I'm using the code shown below. It works without error, but I can't login in AD because it does not recognize the password.

procedure TForm1.Button1Click(Sender: TObject);
begin

   ipwLDAP.DN := 'CN=Test Delphi,OU=ERP,OU=Users and Groups,DC=AD,DC=INTERNAL' ;

   ipwLDAP.AttrCount    := 1 ;

   ipwLDAP.AttrType[0]   := 'userPassword' ;
   ipwLDAP.AttrValueB[0] := TEncoding.Unicode.GetBytes( 'xyz@12345678' ) ;
   ipwLDAP.AttrModOp[0]  := amoReplace ;

   ipwLDAP.Modify ;

   ShowMessage(ipwLDAP.ResultDescription ) ;

end;

I tried use unicodePwd but I get this error :

Error: 53 - 0000001F: SvcErr: DSID-031A124C, problem 5003 (WILL_NOT_PERFORM), data 0

procedure TForm1.Button1Click(Sender: TObject);
begin

   ipwLDAP.DN := 'CN=Test Delphi,OU=UsersERP,OU=Users and Groups,DC=AD,DC=INTERNAL' ;

   ipwLDAP.AttrCount    := 1 ;

   ipwLDAP.AttrType[0]   := 'unicodePwd' ;
   ipwLDAP.AttrValueB[0] := TEncoding.Unicode.GetBytes( 'xyz@12345678' ) ;
   ipwLDAP.AttrModOp[0]  := amoReplace ;

   ipwLDAP.Modify ;

   ShowMessage(ipwLDAP.ResultDescription ) ;

end;

Does anyone know the correct way to do this?

Thanks for any help

2
  • Maybe helpful: developer.sailpoint.com/discuss/t/… - one potential reason: new password does not meet minimum password complexity policy. Commented Apr 11, 2024 at 8:57
  • Thanks for replying ! About password policy isn't the problem because it works when I put this password manually and follow login. I saw your link and there is a list of error messages that will be usefull. Anyway, thanks! Commented Apr 11, 2024 at 11:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.