----- Forwarded message from "Harum, Bradford" <Bra...@in...> -----
Date: Wed, 6 Mar 2002 09:24:37 -0600
To: <gb...@po...>
From: "Harum, Bradford" <Bra...@in...>
Subject: question about NET::LDAP
HI,
I recently tried using the NET::LDAP package to add a new user to my Directory server, I keep getting a error that I don't understand and I was woundering if you could tell me what I am doing wrong.. Any help here would be greatly apprieciated. I attached the source code I am using and a copy of the error I get.
The error: failed to add entry: Type or value exists at b.pl line 27
I checked my directory server and there is no such value. The code is attached. <<b.pl>>
Thank you.
Brad Harum
Content-Description: b.pl
use Net::LDAP;
use strict;
# base: o=infores.com
my $base = 'o=infores.com';
my $host = 'bradspcb';
my $port = 389;
my $ldap = Net::LDAP->new($host, port => $port);
#$ldap->bind; # anonymous bind
$ldap->bind( "cn=Directory Manager", password => "password");
my $result = $ldap->add (
dn => 'cn=mark Jensens,o=infores.com',
attr => [ 'cn' => ['mark Jensens', 'mark Jensens'],
'sn' => 'Jensens',
'mail' => 'm.j...@no...',
'objectclass' => ['top', 'person',
'organizationalPerson',
'inetOrgPerson' ],
]
);
$result->code && warn "failed to add entry: ", $result->error ;
$ldap->unbind;
----- End forwarded message -----
|