I've got a group with a vast amount of members to run a daily check
against AD. It consumes a lot of memory when done simply by looping,
something like this:

for each member of local group
for each member of remote group
if member not found in remote add member to remote
for each member of remote group
for each member of local group
if member not found in local remove from remote

Do you have any ideas on how to handle this kind of stuff a bit more
memory efficient? I could do an external LDAP script but that is not
preferred.