How do I retrieve operational attributes for an LDAP entry using Net::LDAP?

how do I retrieve the values for 'creatorsName','createTimestamp',
'modifiersName',
 'modifyTimestamp' using Net::LDAP module?

pleae help
=====
use Net::LDAP;
use Net::LDAP::Util qw(ldap_error_text ldap_error_name ldap_error_desc);
$host='xxxx.com';
$rdn='cn=manager,dc=xxxx,dc=com';
$ldappasswd='123456';
my $ldap=new Net::LDAP($host) or die;
my $mesg=$ldap->bind("$rdn",password=>"$ldappasswd",version => 3)  or die;
my
$mesg=$ldap->search(base=>"ou=people,dc=xxxx,dc=com",scope=>"sub",filter=>'(
objectClass=*)',) or die;
my $entry;
my $result;
my $i;
my $max = $mesg->count;
my $x=0;
  for(my $i = 0 ; $i < $max ; $i++) {
    my $entry = $mesg->entry($i);
    my $tdn = $entry->dn;
     print 'dn: ' . $tdn,"\n";
     foreach my $attr ($entry->attributes()) {
     my @value=$entry->get_value($attr);
     print "$attr: ";
     foreach my $value(@value){
      print "$value\n";
      }
      }
print "modifytime: " . $entry->get_value("modifyTimestamp") , "\n";

print "===================================\n";
}
$ldap->unbind();




0
sonet
3/12/2005 8:57:45 AM
perl.ldap 1268 articles. 0 followers. Follow

1 Replies
1141 Views

Similar Articles

[PageSpeed] 21
Get it on Google Play
Get it on Apple App Store

On 12/3/05 8:57 am, news.hinet.net <sonet.all@msa.hinet.net> wrote:

> how do I retrieve the values for 'creatorsName','createTimestamp',
> 'modifiersName',
>  'modifyTimestamp' using Net::LDAP module?
> 
> pleae help

There are some examples of doing this in the Net::LDAP man page. Search
<http://search.cpan.org/~gbarr/perl-ldap/lib/Net/LDAP.pod> for
"createTimestamp"!

Cheers,

Chris


0
chrisridd
3/12/2005 9:32:33 AM
Reply: