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.

Reply via email to