Hi,
all i am writing a perl script to do a a bulk add of users from a file and load it to LDAP
[code=perl]
$ldap = Net::LDAP->new("test.doma in.com", port=>3394) or die "Can not
connected to LDAP \n";
$mesg=$ldap->bind("uid=test user,ou=applica tionstest,o=sys temresourcestes t,o=hainet,dc=h ainet,dc=com",p assword=>"secre t");
$cn="$last_name $first_name";
#---------------------LDAP CONNECTION------------------
#-----------------------------------------------------
$dn="uid=$e_num ber,ou=applicat ionstest,o=syst emresourcestest ,o=hainet,dc=ha inet,dc=com";
#$dn="uid=testu ser,dc=hainet,d c=com";
if($action eq "A"){
$result = $ldap->add($dn,
attr => [
'uid'=>'$e_numb er',
'cn' =>'$cn',
'sn' => '$first_name',
'objectclass' => ['person','organ izationalPerson ',
'inetOrgPerson' ],
]);
$result->code && warn "error: ", $result->error;
#$ldap->unbind;
}
}
[/code]
When i run this code i am getting an" Insufficient 'add' privilege to add"
is this an error related to my code or is it an error related to the factb that i don't have the rights to add user. I am very new to LDAP so your help would greatly be appreciated.
all i am writing a perl script to do a a bulk add of users from a file and load it to LDAP
[code=perl]
$ldap = Net::LDAP->new("test.doma in.com", port=>3394) or die "Can not
connected to LDAP \n";
$mesg=$ldap->bind("uid=test user,ou=applica tionstest,o=sys temresourcestes t,o=hainet,dc=h ainet,dc=com",p assword=>"secre t");
$cn="$last_name $first_name";
#---------------------LDAP CONNECTION------------------
#-----------------------------------------------------
$dn="uid=$e_num ber,ou=applicat ionstest,o=syst emresourcestest ,o=hainet,dc=ha inet,dc=com";
#$dn="uid=testu ser,dc=hainet,d c=com";
if($action eq "A"){
$result = $ldap->add($dn,
attr => [
'uid'=>'$e_numb er',
'cn' =>'$cn',
'sn' => '$first_name',
'objectclass' => ['person','organ izationalPerson ',
'inetOrgPerson' ],
]);
$result->code && warn "error: ", $result->error;
#$ldap->unbind;
}
}
[/code]
When i run this code i am getting an" Insufficient 'add' privilege to add"
is this an error related to my code or is it an error related to the factb that i don't have the rights to add user. I am very new to LDAP so your help would greatly be appreciated.
Comment