My task is to move mass number of users from AD server to ADAM.

50% of the task is done.. i am able to connect to the AD and able to download 
all the users.. . but when i try to connect to this forest ADAM. i am having 
problem.. getting invalid credential errror...

and thought .. will be helpful

the following is the code which i am using to connect ADAM..

adam instance  port number is : 50100



#!perl.exe
use Time::localtime;
use strict;
use Net::LDAP;
use Net::LDAP::Control;
use Net::LDAP::Constant qw(LDAP_CONTROL_PAGED);
use Net::LDAP::Util qw(ldap_error_name ldap_error_text);
#use Authen::SASL;


sub lConnect {
        my $server = shift;
        print " the server name is $server\n";
        my $ldapx = Net::LDAP->new($server, port=> 50101, version => 3);
        print "=== The error is $@ <====\n";
        #$ldapx->debug(15);
    #if($ldapx->code) {
    #    print " ERROR detected: ldap_error_name($ldapx->code) - - - 
ldap_error_text($ldapx->code) $@";
    # }
        #my $ldap = Net::LDAP->new($server, port=>3268) or die "$@";
        return($ldapx);
}


my $server   = '192.111.15.145';
my $user     = 'avasi';
my $pass     = 'password';
my $ldap     = &lConnect($server);
my $isBinded = $ldap->bind("$user", password=>"$pass");
#my $isBinded = $ldap->bind ("$user", sasl => $sasl, version => 3);
print "ERROR detected: -> ", ldap_error_name($isBinded->code), " ", 
ldap_error_text($isBinded->code) if($isBinded->code);

$ldap->unbind;

Reply via email to