1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| use strict;
use Net::LDAP;
CreateNewUser();
sub CreateNewUser
{
my $ldap = Net::LDAP->new( "orme.sva-jeanroze.fr", port => 389, version => 3,raw => qr/(?i:^jpegPhoto|;binary)/);
my $mesg = $ldap->bind ( "cn=administrateur,cn=Users,DC=sva-jeanroze,dc=fr", password => "xxx" );
my $result = $ldap->add( 'cn=Telephonie,dc=sva-jeanroze,dc=fr',
attr => [
'cn' => 'essai',
'sn' => 'essai',
'ipPhone' => '0030',
'unicodePwd' => 'xxx',
'objectclass' => ['top', 'person','organizationalPerson','inetOrgPerson' ]]
);
$result->code && warn "failed to add entry: ", $result->error ;
} |
Partager