Hi, I am not able to retrieve nsaccountlock attribute value using net ldap. I
did able to retrive using ldapsearch command and ldap browser tools ..i am not
sure what i am doing wrong in the code any advise greatly appreciated.
here is the code i used to retrieve
#!/usr/bin/perl
use Net::LDAP::Entry;
use Net::LDAP qw(:all);
use IO::Socket;
use Net::LDAP::Util qw(ldap_error_name
ldap_error_text);
$dn="cn=admin";
$password="comeon";
$version=3;
$url='ldap';
$ldap1 = Net::LDAP->new($url,port=>389) or die "$@";
$mesg1 = $ldap1->bind(dn => $dn,
password => $password,
version => $version);
$ldaperror_code=ldap_error_name($mesg1->code);
$uid="username";
$base="ou=people,dc=com";
$scope="sub";
$filter="uid=$uid";
$result=$ldap1->search(
base => "$base",
scope => "$scope",
filter => "$filter",
);
$ans=$result->count;
$searcherror_code=ldap_error_name($result->code);
print "Searcherrorcode: $searcherror_code \n";
$entry=$result->entry(0);
$arrayref1=$entry->get('status');
$status_value=$$arrayref1[0];
#I am able to print this value
print "Status: $status_value \n";
$arrayref7=$entry->get('nsAccountlock');
$accountlock=$$arrayref7[0];
print "Accountlock: $accountlock \n";
# prints nothing
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com