On 26/10/2011 23:01, Tessio Fechine wrote:
Hello,
I'm trying to delete a user entry in Active Directory using this code:

#!/usr/bin/perl -w

use strict;
use Net::LDAP;

my $server = '192.168.56.1';
my $port   = '389';
my $mesg;

my $c = Net::LDAP->new($server, port =>  $port) or
     die "Unable to connect to $server: $@\n";

my $binddn = "cn=Peter Parker,cn=users,dc=example,dc=com";
my $passwd = "secret";

$mesg = $c->bind($binddn, password =>  $passwd);
die 'Unable to bind: ' . $mesg->error . "\n" if $mesg->code;

my $dn = 'cn=Clark Kent,cn=users,dn=example,dc=com';

$mesg = $c->delete($dn);
die 'Error in delete: '. $mesg->error() ."\n" if $mesg->code();

$c->unbind;

But I keep getting this error message:

Error in delete: 0000202B: RefErr: DSID-031007EF, data 0, 1 access points
     ref 1: 'com'

I already searched the web trying to find the meaning of this error message,
but I didn't find anything about it.

Error 0x202B is ERROR_DS_REFERRAL - "A referral was returned from the
server".

Searching the internet for

  LDAP "A referral was returned from the server"

gives many possible solutions.

Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to