On 7 Apr 2008, at 21:36, unxl3arn3r wrote:
hey i am having trouble doing a moddn, all I want to do is move the
object from one location to other. here is the script
$ldap = new Net::LDAP('10.1.1.2', port=>389) or die $!;
$ldap->bind (dn => 'cn=xxxx,cn=xx,dc=xxx,dc=xxx' ,
               password => 'md01dg72'
       );

my $mesg1 = $ldap->search (
                               base =>"ou=Students, dc=xxx, dc=xxxx",
                               filter => "(criteria = $user*)",
                       ) or die ("Failed on search . $!");

  $ldap_var = $mesg1->entry (0);

  my $DN = $ldap_var->dn;

  print $DN
  $mesg = $ldap->moddn( dn => $DN, newrdn => $ldap_var->dn,

The value for newrdn has to be an RDN (cn=foo), and $ldap_var->dn looks like it is going to be a DN (cn=foo,ou=Students,dc=xxx,dc=xxxx).


           newsuperior => "ou=h, ou=Alumni, ou=Students, dc=fdu,
dc=edu" ,
            ) or warn "$! \n";
  print $mesg , $mesg->error;
The error says " Unknown error" . Anyone wanna shed any light ?
thanks


The version of the server you're using does not support moving entries to different locations in the DIT. Until you upgrade, the only thing you can do is to dump and reload each entry.

Cheers,

Chris

Reply via email to