Good afternoon,

I have the example ldap working in Lazarus IDE, which displays the LDAP search in the Memo control.

I need some suggestion to retrieve the results into a list box. I think I need the TLDAPAttribute, but not sure.

What should I use to pull the attributes from the ldapsearch?

My goal is to populate an email client application with email addresses from the DC.

Very best regards,

Bret Stern

Here is my sample:

procedure TForm1.Button1Click(Sender: TObject);
var
  ldap: TLDAPsend;
  l: TStringList;
  al: TLDAPAttribute;
  s: string;



begin
  ldap:= TLDAPsend.Create;
  l := TStringList.Create;
  al := TLDAPAttribute.Create ;

  try
     ldap.TargetHost := '192.168.40.50';
     ldap.UserName := 'administra...@internal.domain.com';
     ldap.Password := 'PASSWORD123';


    if ldap.Login then
      if ldap.Bind then
      begin
          ShowMessage('Connected to LDAP');
          //l.Add('displayname');
          //l.Add('description');
          //l.Add('givenName');
          l.Add('mail');
          //l.Add('*');
ldap.Search('OU=Users,OU=MM,DC=internal,DC=domain_name,DC=com', False, '(objectclass=Person)', l);

          //al.Values.  := ldap.SearchResult.UnitName ;

          //memo1.Lines.Add(LDAPResultDump(ldap.SearchResult));
          //memo1.Lines.Add
        ldap.Logout;
      end;
  finally
    ldap.Free;
  end;
end;





_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to