Hi!

i am having a bit of trouble trying to get this right.

I have a list of uids:full names that i need to match in ldap. I want to search the Full Name if the uid does not match. (not all will.)

while (<FH1>)   {
                       @map = split(/:/,$_);
                       chomp();
$mesg = $ldap->search ( filter=>"(sAMAccountName=$map[0])",
                       base=>"blah blah",
                       attrs=> ['mail', 'cn', 'distinguishedName'], );

something here... if the sAMAccountName returns no matches (successful bind) then try the displayName,(FULL NAME)

# || $mesg = $ldap->search ( filter=>"(displayName=$map[1])",
                       #base=>"blah blah",
                       #attrs=> ['mail', 'cn', 'distinguishedName'],
                       #);
$mesg->count or warn "$map[0]\|$map[4]\|no_matches\n";
                       @entries = $mesg->entries;
                               foreach $entry (@entries) {
@attrs = $entry->attributes(); $stuff = $entry->get_value(mail); $dn = $entry->get_value(distinguishedName); print OUT, "stuff about blah blah and things";
                                                          }

--
Luis E. Cerezo
PGS Global Shared Services - IT


Reply via email to