Hello all,

I'm a bit new to Net::LDAP and need little help.  I am trying to script an
LDAP->add to automate the insertion of new customers to our directory.

I am successful when I insert attributes into ou=<company
name>,ou=TradingPartners,o=marketsite,o=company.com.  The problem occurs
when I attempt to add an ou underneath this entry.  I am trying to add
ou=Contacts,ou=<company name>,ou=TradingPartners,o=marketsite,o=company.com.
The script runs without producing any errors, but this sub-ou never shows up
in LDAP browser.  I also have difficulty deleting the entry that is visible.
LDAP browser complains that the delete cannot be performed on a non-leaf
item as if this sub-ou is really present.  I really appreciate any help you
can give.





my $result =
$ldap->add("ou=$tpshortname,ou=TradingPartners,o=marketsite,o=company.com",
            attr => [ 'displayName' => $tpshortname,
                      'postalCode'  => '12345',
                      'objectClass' => 'msbtradingpartner',
                      'objectClass' => 'organizationalunit',
                      'objectClass' => 'top',
                      'url'         => '',
                                    .
                                    .
                                    .
                                    .
                                    .
                     'c'  => 'US',
                     'msbauthorizingentityid' => $mpid
                     ]);
   $result->code && warn "error: ", $result->error;

my $result2 =
$ldap->add("ou=Contacts,ou=$tpshortname,ou=TradingPartners,o=marketsite,o=co
mpany.com",
             attr => [ 'ou'      => 'Contacts',
                       'objectClass:' => 'organizationalunit',
                       'objectClass:' => 'top'
                     ]);
 $result2->code && warn "error: ", $result2->error;


Reply via email to