Hmm. To be honest I'm not sure

I assumed that someone would have already provided this functionality, but a quick search has not shown up anything useful.

What is your LDAP server based on? Commonly they have a SQL back-end where the data is actually stored so you can interrogate this directly rather than using LDAP.