hi, On Fri, Dec 11, 2015 at 12:15 PM, Clément OUDOT <clem.ou...@gmail.com> wrote:
> You should do a search directly on the member DN (with scope base) instead > of requestind the suffix in sub _get_ad_user_mail : > > sub _get_ad_user_mail { > my ($ad_user) = @_; > my $search_ad = $ad_ldap->search( > base => $ad_user, > scope => "base", > filter => "(objectclass=*)", > attr => ['mail'], > ); > > $search_ad->code && die "error on search ad: $@: " . $search_ad->error; > for my $entry ( $search_ad->entries ) { > my $ad_user_mail = $entry->get_value('mail'); > return $ad_user_mail; > } > } > > mmm, not very much difference, I'm afraid. Now it's even a bit slower: 2m45sec. Could be network bound (behind a vpn connection now). Maybe I need to get a list of users and save its info in another hash, that could be much faster than making lots of queries per group. -- -- Groeten, natxo