Skip to content

Instantly share code, notes, and snippets.

@jreisinger
Created May 13, 2013 20:51
Show Gist options
  • Save jreisinger/5571419 to your computer and use it in GitHub Desktop.
Save jreisinger/5571419 to your computer and use it in GitHub Desktop.
LDAP client
#!/usr/bin/perl
use strict;
use warnings;
use Net::LDAP;
my $ldap = Net::LDAP->new("dom0.dyndns.org") or die $@;
$ldap->bind();
my $base_dn = "dc=dom0,dc=dyndns,dc=org";
my $mesg = $ldap->search( base => $base_dn, filter => "uid=*" );
$mesg->code() && die $mesg->error;
foreach my $result ( $mesg->all_entries ) {
$result->dump;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment