http://qs321.pair.com?node_id=596683


in reply to Comparing ldap data using net ldap

The simplest way to do this is to search the entire master directory, and iterate over the record set.

use strict; use Net::LDAP; my $ld = Net::LDAP->new('myserver'); $ld->bind(dn=>'username',password=>'passwd'); my $result = $ld->search(base=>'cn=mydir', scope=>'sub', filter=>'(objectclass=*)'); while (my $entry = $result->entry()) { #do comparison here }

You'll probably need to use page support and/or async searching if your directory contains much in the way of data.

One thing to watch out for: I've done this sort of thing a few times, and tended to find that detecting when entries/attributes aren't there is the trickiest bit. It's also worth noting that there are commercial apps available that will do this sort of thing for you.

--------------------------------------------------------------

"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".

Replies are listed 'Best First'.
Re^2: Comparing ldap data using net ldap
by klekker (Pilgrim) on Jan 26, 2007 at 10:02 UTC
      Thanks. The callback may work for me since I am walking the entire ldap tree and comparing entries against the secondary ldap entries.