#!perl use strict; use warnings; use Net::LDAP; my $host = 'xxx.xxx.xxx.xxx'; my %options = ( # fill these in ); my $ldap = Net::LDAP->new( $, %options } ) or die "LDAP connect failed for: " . $host; my $mesg = $ldap->bind( "cn=Test User,ou=user,ou=accounts,ou=our,dc=our,dc=domain,dc=com" , password => 'secret admin password', ); warn "LDAP response when binding: " . $mesg->error; my $srch = $ldap->search( base => "c=US", # perform a search filter => "(&(sn=Barr)(o=Texas Instruments))" );