From: Mark W. <mew...@un...> - 2000-05-18 16:41:35
|
Well this is hard to fix when you haven't really described the problem. Are you not getting any results? Or are you only getting some of the attributes? I have made a copy of your code and searched against a server and it works. I don't remember having any problems with Net::LDAP v.15. We had some bugs like this in .16 but those were related to switching to Convert::ASN1, Convert::BER worked fine AFAIR. If you could do the following it would really help. 1) give a better description of the problem 2) show us some example output and where the problem lies 3) send results of using $ldap->debug(3) (put this after you connect to the server). Also are you binding anonymously in ADSI? (don't ask me on my opinion on the ADSI API ;). We have several people who've used this code against Exchange for a long time, so I'm sure we can figure this out. Mark On Thu, 18 May 2000, Neil Betty wrote: > Hi guys; > > I'm now working in perl and having problems accessing the exchange server. > The project requires me to use ldap as the communication protocol. What I'm > having difficulties in is reading these attributes in perl-ldap(version 15). > I tried to explicitly call the attributes but maybe I'm not doing it right > or something is wrong with your code. > > I'm going to try loading the perl-ldap(version 17) next week an see if there > is any improvement. Obviously you are able to see these attributes when > using ASDI-ldap in vbscript but why not in you code. > > I wondering how would you do this using ldapapi a module for perl? > > Could someone help me a working example of accessing these attributes in > your environment using perl-ldap v15,v17? > > I will take qbarr advice and read up on NET::LDAP::Entry but I believe it > could be NET::LDAP::Mesg could be the problem for this one. I'll will > patiently wait a response. > > Here is the code > > #perform binding to Server > my $ldap = Net::LDAP->new($servername,port=>$portnum) or die "$@"; > $ldap->bind; #an anonymous bind > > my $mesg = $ldap->search ( # perform a search > base => $base, > #scope => "sub", > filter => '(&(cn=neil*)(sn=b*)', > attrs => ['cn','mail','Extension-Attribute-1', > 'Extension-Attribute-3','department', > 'Extension-Name'] > ); > > } > > $mesg->code && die $mesg->error; > > my $entry; > my $ictr; > foreach $entry ($mesg->all_entries) > { > > $entry->dump; > $ictr++; > } > > $ldap->unbind; # take down session > print $ictr; > > Here are the attributes that are hidden: > > Hide-From-Address-Book > mailPreferenceOption > Extension-Attribute-1 > Extension-Attribute-10 > Extension-Attribute-11 > Extension-Attribute-12 > Extension-Attribute-13 > Extension-Attribute-14 > Extension-Attribute-15 > Extension-Attribute-2 > Extension-Attribute-3 > Extension-Attribute-4 > Extension-Attribute-5 > Extension-Attribute-6 > Extension-Attribute-7 > Extension-Attribute-8 > Extension-Attribute-9 > Extension-Name > Home-MTA > Telephone-Assistant > Telephone-Home2 > memberOf > > > Thanks for reading > > Neil > > |