Hi, i am searching and searching for a way to use ldapsend and query for deleted objects. I need to user server controls but i really don't know how to do this. This is the control that i neet to pass to server and make an extended search: LDAP\_SERVER\_SHOW\_DELETED\_OID control code
| | | | | | | | | | | LDAP\_SERVER\_SHOW\_DELETED\_OID control code Used with an extended LDAP search function to specify that the search results include any deleted objects that m... | | | I have tried everthing...no results. Please, please help :-) This is how i have modified ldapsend.pas ~line 1123 if FSearchPageSize > 0 then begin c := ASNObject('1.2.840.113556.1.4.319', ASN1_OCTSTR); // controlType: pagedResultsControl c := c + ASNObject(ASNEncInt(0), ASN1_BOOL); // criticality: FALSE t := ASNObject(ASNEncInt(FSearchPageSize), ASN1_INT); // page size t := t + ASNObject(FSearchCookie, ASN1_OCTSTR); // search cookie t := ASNObject(t, ASN1_SEQ); // wrap with SEQUENCE c := c + ASNObject(t, ASN1_OCTSTR); // add searchControlValue as OCTET STRING c := ASNObject(c, ASN1_SEQ); // wrap with SEQUENCE s := s + ASNObject(c, LDAP_ASN1_CONTROLS); // append Controls to SearchRequest end; // c := ASNObject('1.2.840.113556.1.4.417', ASN1_OCTSTR); // controlType: pagedResultsControl //c:=c+ ASNObject(ASNEncInt(0), ASN1_INT); //c:=c+ ASNObject('', ASN1_NULL); c := c + ASNObject(ASNEncInt(0), ASN1_BOOL); // criticality: FALSE s := s + ASNObject(c, LDAP_ASN1_CONTROLS); // Fsock.SendString(BuildPacket(s)); And main.pas is like this: subschemaDN:='CN=Deleted Objects,DC=RBRO,DC=RBG,DC=CC'; lattr.Clear; lattr.Add('distinguishedName'); lattr.Add('isDeleted'); ldap.SearchPageSize:=0; ldap.SearchScope:=SS_BaseObject; //ldap.Extended('1.2.840.113556.1.4.417',''); //ldap.Search(subschemaDN,False,'(&(isDeleted=*)(msDS-LastKnownRDN=*)',lattr); ldap.Search(subschemaDN,False,'',lattr); memo1.Lines.Add(Inttostr(ldap.SearchResult.Count)); Memo1.Lines.BeginUpdate; for i:= 0 to ldap.SearchResult.Count -1 do begin memo1.Lines.Add(ldap.SearchResult.Items[i].ObjectName); for j:=0 to ldap.SearchResult.Items[i].Attributes.Count -1 do begin memo1.Lines.Add(' ' + ldap.SearchResult.Items[i].Attributes.Items[j].AttributeName+#09+ ldap.SearchResult.Items[i].Attributes.Items[j].CommaText); end; end; Maybe i don't need to modifiy ldapsend.pas to add this request, but i really don't know how to do it. I have adapted the modification for pagedresult, with the one for LDAP_SERVER_SHOW_DELETED_OID control code. No such luck.. Many thanks for helping a desperate guy! :-)
_______________________________________________ synalist-public mailing list synalist-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synalist-public