Getting the largest uidNumber in OpenLDAP

So you know how sometimes you're trying to get the highest uidNumber in OpenLDAP?  You know, especially when adding new users and trying to figure out the latest uidNumber to assign to them?  I searched Google high and low to figure out this while working on my implementation of "adduser …

more ...