2
什么是使用网:: LDAP添加OU的正确语法添加LDAP OU,我试过如下:使用的Net :: LDAP
#!/usr/bin/perl -w
use 5.10.1;
use strict;
use Net::LDAP;
use Data::Dumper;
my $ldap = Net::LDAP->new("192.168.183.2") or die "[email protected]";
my $mesg = $ldap->bind("cn=admin,dc=lab,dc=net", password => 'xxx');
$mesg = $ldap->add(
"ou=Users,dc=lab,dc=net",
attrs => [
'ou' => 'dc=Users',
'objectClass' => [ 'top', 'organizationalUnit' ]
]
);
say $mesg->error;
say $mesg->code;
而且得到了以下错误:
value of naming attribute 'ou' is not present in entry 64
但是使用ldapmodify命令行,并使用该下面的ldif,工作原理:
dn: ou=Users,dc=lab,dc=net
changetype: add
objectclass: top
objectclass: organizationalUnit
ou: Users