hi Clément,

On Wed, Dec 16, 2015 at 10:38 AM, Clément OUDOT <clem.ou...@gmail.com>
wrote:

>
>
> 2015-12-16 10:31 GMT+01:00 Natxo Asenjo <natxo.ase...@gmail.com>:
>
>>
>> my $result = $ldaptest->add(
>>     "$dn",
>>     attrs => [
>>         'objectclass'    => [qw/top group/],
>>         'cn'             => "cn=$nested_group",
>>         'samAccountName' => "$nested_group",
>>         'grouptype'      => 0x80000002,
>>         'member'         => [@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'         => \@groups,
>


sorry, again operator error. The solution was:

my $result = $ldaptest->add(
    "$dn",
    attrs => [
        'objectclass'    => [qw/top group/],
        'cn'             => "$nested_group",
                               ^
        'samAccountName' => "$nested_group",
        'grouptype'      => 0x80000002,
        'member'         => [@groups],
    ]
);

not   'cn'             => "cn=$nested_group",
                              ^^^^


--
Groeten,
natxo

Reply via email to