Skip to content

Instantly share code, notes, and snippets.

@oremj
Created November 7, 2009 08:09
Show Gist options
  • Save oremj/228614 to your computer and use it in GitHub Desktop.
Save oremj/228614 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
use Net::LDAP;
use strict;
my $mesg;
my $ldap = Net::LDAP->new( 'pm-ns' );
my @os=('com', 'net', 'org');
foreach my $o (@os) {
$mesg = $ldap->bind('mail='.$ARGV[0].',o='.$o.',dc=mozilla', password =>$ARGV[1] );
if($mesg->code == 0) {
$ldap->unbind;
exit(0);
}
}
$ldap->unbind;
exit(-1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment