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