From: Neil B. <NB...@ab...> - 2000-05-18 16:22:30
|
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 |