I want to upload a list of users from my work's LDAP server to upload into our wiki as a company directory. How can I download a list of users from an LDAP server using Perl?
Thanks.
Use the NET::LDAP module.
A little example from the POD:
use Net::LDAP;
$ldap = Net::LDAP->new( 'ldap.bigfoot.com' ) or die "$@";
$mesg = $ldap->bind ;    # an anonymous bind
$mesg = $ldap->search( # perform a search
                       base   => "c=US",
                       filter => "(&(sn=Barr) (o=Texas Instruments))"
                     );
$mesg->code && die $mesg->error;
foreach $entry ($mesg->entries) { $entry->dump; }
$mesg = $ldap->unbind;   # take down session
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With