Re: NameErr: DSID-03050C55, problem 2003 (BAD_ATT_SYNTAX) when adding group with nested group
Clément OUDOT <[email protected]> Wed, 16 Dec 2015 10:38:09 +0100
| Newsgroups | gmane.comp.lang.perl.modules.ldap |
|---|---|
| Message-ID | <CAK_oV4_sfJbMdh1DLafVD8Xpgjpuw978cBBZPEGWECtifsc3jQ@mail.gmail.com> |
--047d7beb94580916ff052700aa41 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2015-12-16 10:31 GMT+01:00 Natxo Asenjo <[email protected]>: > hi, > > creating a group with nested groups in it fails with error > > NameErr: DSID-03050C55, problem 2003 (BAD_ATT_SYNTAX), data 0, best match > of: > > in ldap AD 2008r2 > > This is the code: > > my $nested_group =3D "HRM - Management"; > my $dn =3D "cn=3D$nested_group,$test_base"; > > my @groups =3D ( > "cn=3Dhrm - management - mt,$test_base", > "cn=3Dhrm - management - directie,$test_base" > ); > > my $result =3D $ldaptest->add( > "$dn", > attrs =3D> [ > 'objectclass' =3D> [qw/top group/], > 'cn' =3D> "cn=3D$nested_group", > 'samAccountName' =3D> "$nested_group", > 'grouptype' =3D> 0x80000002, > 'member' =3D> [@groups], > ] > ); > > $result->code && warn "failed to add group $dn ", $result->error; > > Adding users is no problem. Do you know what I'm doing wrong? > You need to pass an array ref to the member attribute : 'member' =3D> \@groups, Cl=C3=A9ment. --047d7beb94580916ff052700aa41 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo= te">2015-12-16 10:31 GMT+01:00 Natxo Asenjo <span dir=3D"ltr"><<a href= =3D"mailto:[email protected]" target=3D"_blank">[email protected]= </a>></span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0= px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div = dir=3D"ltr"><div>hi,<br><br></div>creating a group with nested groups in it= fails with error <br><br clear=3D"all"><div><div><div>NameErr: DSID-03050C= 55, problem 2003 (BAD_ATT_SYNTAX), data 0, best match of:<br><br></div><div= >in ldap AD 2008r2<br></div><div><br>This is the code:<br><br>my $nested_gr= oup =3D "HRM - Management";<br>my $dn =3D "cn=3D$nested_grou= p,$test_base";<br><br>my @groups =3D (<br>=C2=A0=C2=A0=C2=A0 "cn= =3Dhrm - management - mt,$test_base",<br>=C2=A0=C2=A0=C2=A0 "cn= =3Dhrm - management - directie,$test_base"<br>);<br><br>my $result =3D= $ldaptest->add(<br>=C2=A0=C2=A0=C2=A0 "$dn",<br>=C2=A0=C2=A0= =C2=A0 attrs =3D> [<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'o= bjectclass'=C2=A0=C2=A0=C2=A0 =3D> [qw/top group/],<br>=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'cn'=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D> "cn=3D$nested_group= ",<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'samAccountName&#= 39; =3D> "$nested_group",<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 'grouptype'=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D> 0x80000= 002,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'member'=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D> [@groups],<br>=C2=A0=C2= =A0=C2=A0 ]<br>);<br><br>$result->code && warn "failed to a= dd group $dn ", $result->error;<br><br></div><div>Adding users is n= o problem. Do you know what I'm doing wrong?<br></div></div></div></div= ></blockquote><div><br><br></div><div>You need to pass an array ref to the = member attribute :<br><br>=C2=A0'member'=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 =3D> \@groups,<br><br><br></div><div>Cl=C3=A9ment.= <br></div></div></div></div> --047d7beb94580916ff052700aa41--