I am using HP's Netscape Directory Server 6.22 and HP's LDAP-UX Client Services 3.30 on HP-UX 11.11. I have imported netscape.ldap.* as well as javax.naming.* and javax.naming.directory.*. I used their scripts which migrated NIS into LDAP. Much of the fields in a /etc/passwd user line are now attributes in LDAP.
Like in NIS or using just the plain /etc/passwd file for authentication, adding a new user would just increment the unique user ID number or UID number. In LDAP, the UID number is designated as the attribute uidNumber. To get the greatest uidNumber, would I have to loop through the entire LDAP directory of the user IDs just to get the largest uidNumber plus one just so I can assign it with LDAPAttributeSet and add it with LDAPEntry? Is there a more efficient way with using the Java's JNDI to get the greatest uidNumber attribute of all the LDAP users?