# ldap-vars my $ldap_server = "127.0.0.1"; my $ldap_port = "389"; my $base = "cn=users,dc=intern"; my $filter = Net::LDAP::Filter->new( "(uidNumber>=1000)" ); # ldap connect my $ldap = Net::LDAP->new( $ldap_server, PORT => $ldap_port) or die "$@"; my $mesg = $ldap->bind('uid=diradmin,cn=users,dc=intern',password => password); $mesg = $ldap->search( base => $base, filter=> $filter, ) or die "$!"; foreach $entry ($mesg->all_entries) { print $entry->get_value('cn')."\n"; print $entry->get_value('uid')."\n"; print $entry->get_value('uidNumber')."\n"; }