Hi Luca! :-)
It works, thank you very much!! 
After setting objectClass everything works.
These are the minimum attributes that you have to set to create an user in AD:

procedure TForm1.MenuItem21Click(Sender: TObject);                              
// Popup2 - Create uservar  aAttr:TLDAPAttribute;  
aAttrList:TLDAPAttributeList;begin  aAttrList:=TLDAPAttributeList.Create;
  aAttr:=aAttrList.Add;  aAttr.AttributeName:='cn';  aAttr.Add('srlDMTest');
  aAttr:=aAttrList.Add;  aAttr.AttributeName:='objectClass';  aAttr.Add('user');
  aAttr:=aAttrList.Add;  aAttr.AttributeName:='sAMAccountName';  
aAttr.Add('srlDMTest');
  
ldap.Add('CN=srlDMTest,OU=Risk,OU=Users,OU=Leasing,OU=Subsidiary,OU=RBRO,DC=RBRO,DC=RBG,DC=CC',aAttrList);
  ShowMessage(ldap.ResultString);
  aAttrList.Free;end;  

    On Saturday, September 25, 2021, 02:09:32 AM GMT+3, Luca Olivetti 
<l...@ventoso.org> wrote:  
 
 El 24/9/21 a les 22:33, Dalacu Marius via synalist-public ha escrit:
> Thank you for replying :-)
> I have read and the only attributes required are *cn *and *sAMAccountName*
> https://docs.microsoft.com/en-us/windows/win32/ad/creating-a-user 
> <https://docs.microsoft.com/en-us/windows/win32/ad/creating-a-user>

I suppose that's when you use microsoft tools instead of ldap

> I also read that it defaults to objectclass "person" if the attribute is 
> missing.

I don't see objectclass anywhere in your link but only objectcategory

> Does it work for you?

Yes, it does, but I set the objectclass, along with a bunch of other 
attributes.


Bye
-- 
Luca


_______________________________________________
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