active-directoryldapsambaldif

Is there way to setup `primaryGroupId` for user using ldif?


I want to setup PrimaryGroupId for user. For that purpose I've created the with content:

dn: CN=user_2,CN=Users,DC=my,DC=company
changetype: modify
replace: primaryGroupID
primaryGroupID: 501

But when I execute ldbmodify command I get the error:

/ # LDB_MODULES_PATH=/usr/lib/samba/ldb/ ldbmodify -H /var/lib/samba/private/sam.ldb /tmp/primary_group.ldif 
'rror: Bad ldif changetype 'modify
 at block before line 3!" on DN CN=user_2,CN=Users,DC=my,DC=company=my,DC=company
Modify failed after processing 0 records

Is there way to setup primaryGroupId for user using ldif ?


Solution

  • This works:

    dn: CN=user_2,CN=Users,DC=my,DC=company
    changetype: modify
    delete: primaryGroupID
    add: primaryGroupID
    primaryGroupID: 501