Hi.
The problem is that i don't know how to use TLDAPSend.Add function. 
I don't know what i have to put in the parameters.
|  | function Add(obj: AnsiString; const Value: TLDAPAttributeList): Boolean; |

Add list of attributes to specified object.

What does obj stands for? Is it the DN of the resulting object, is ith the DN 
of the OU that the object will reside in?
I have tried every combination that I could think of....
Any help will be appreciated :-) procedure TForm1.MenuItem21Click(Sender: 
TObject);                              // Popup2 - Create uservar  
aAttr:TLDAPAttribute;  aAttrList:TLDAPAttributeList;  sResultText:string;begin  
ldapReBind;
  //aAttr:=TLDAPAttribute.Create;  aAttrList:=TLDAPAttributeList.Create;
  aAttr:=aAttrList.Add;  aAttr.AttributeName:='sn';  aAttr.Add('srlDMTest');
  aAttr:=aAttrList.Add;  aattr.Clear;  aAttr.AttributeName:='cn';  
//aAttr.Add('srlDMTest')  
aAttr.Add('CN=srlDMTest,OU=Risk,OU=Users,OU=Leasing,OU=Subsidiary,OU=RBRO,DC=RBRO,DC=RBG,DC=CC');
  
aAttrList[1].ValueFromIndex[0]:='CN=srlDMTest,OU=Risk,OU=Users,OU=Leasing,OU=Subsidiary,OU=RBRO,DC=RBRO,DC=RBG,DC=CC';
 //aAttr.Add, truncates the first part of the string, why?!  
aAttr:=aAttrList.Add;  aAttr.AttributeName:='sAMAccountName';  
aAttr.Add('srlDMTest');
{  aAttr:=aAttrList.Add;  aAttr.AttributeName:='name';  aAttr.Add('srlDMTest');}
  //ShowMessage(intToStr(aAttrList.Count));  
ShowMessage(aAttrList[1].AttributeName);  
ldap.Add('CN=srlDMTest,OU=Risk,OU=Users,OU=Leasing,OU=Subsidiary,OU=RBRO,DC=RBRO,DC=RBG,DC=CC',aAttrList);
  //ldap.Add('',aAttrList);  ShowMessage(ldap.ResultString);
  aAttrList.Free;  //aAttr.Free;end;            On Friday, September 24, 2021, 
01:26:51 PM GMT+3, <wkitt...@windstream.net> wrote:  
 
 On 9/23/21 4:51 AM, Dalacu Marius via synalist-public wrote:
> Hi,
> i am trying to *create a new user in AD*.
> Can you provide a simple example how i can use function
> TLDAPSend.Add to accomplish this?
> I have tried everything that i could think off. Error is 0000207B: UpdErr: 
> DSID-030514A9, problem 6002 (OBJ_CLASS_VIOLATION), data 0

without seeing code, guessing is the only option...


-- 
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list where it belongs!*


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

Reply via email to