perl - Adding LDAP OU using Net::LDAP -


net :: What is the correct syntax for adding an OU using LDAP, I tried the following:

  #! / Usr / bin / perl -w 5.10.1; Strict use; Net :: LDAP; Use data: Dumper; My $ ldap = Net :: LDAP- & gt; New ("192.168.183.2") or die "$ @"; My $ mesg = $ ldap- & gt; Tie ("cn = admin, dc = lab, dc = net", password => xxx '); $ Mesg = $ ldap- & gt; Add ("ou = user, dc = lab, dc = net", atres => gt; ['ou' = & gt; 'dc = user', 'object class' => [' top ',' organizational Unit' ]       ] ); $ Mesg- & gt; Error; $ Mesg- & gt; Code;  

and found the following error:

  The value of the enrollment attribute 'OU' is not present in entry 64  

However, using the ldapmodify command line, and works by using the following procedure:

  dun: ou = users, dc = lab, dc = net changetype: add objectclass: top Object Class: Organizational Devices: Users  

  'ou' => 'Dc = user',  

This line needs to be modified:

  'ou' => 'User',  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -