> On 11 Jun 2015, at 22:45, David Lee Lambert <dav...@lmert.com> wrote:
> 
> I know this question has been asked before, but maybe the 
> answers were in response to differnt details...
> 
> I'm trying to write a script that compares data in an Oracle
> database with Active Directory.  So, it seems like I should be
> able to use DBD::Oracle and Net::LDAP, but I can't seem to get
> bind() to work.
> 
> I've reduced my non-working code to the following...
> 
> #! perl -w
> 
> use Net::LDAP;
> my $ad = Net::LDAP->new('ad.**org**.com', debug => 2)
>  or die "Couldn't connect to AD: $@, $!";
> $ad->bind('**tried lots of stuff**', password => '**password**')
>  or die "Couldn't bind: $@, $!”;

I think what you’re checking here is a failure to either construct the bind 
operation or send the bind to the server.

But this *isn’t* the right way to check for bind failures. Binds are just 
another LDAP operation which returns a result, so you should check the result 
message like you do for search further down.

This won’t solve your underlying problem with AD, but you might get more of an 
idea what’s failing if you look at the bind result.

Chris

Reply via email to