简体   繁体   中英

Get most recent ldap entry

I'm running into an issue currently that I can't seem to figure out. I'm attempting to write an LDAP query that retrieves the most recent entry in a directory. There doesn't seem to be native functionality to do this, and all information I'm finding requires other information about the sought after entry to be known.

If I were using a database, I could just sort the entries by 'dateCreated' and limit the results to 1, however with an LDAP query to a Directory Server, I don't believe that's possible.

Any tips/advice would be greatly appreciated, thanks!

LDAP RFC 4512 defines a standard attribute named createTimestamp that is automatically set by the server on every object created in the directory. It also defines modifyTimestamp for update operations. Since these are operational attribute, they will only be returned when you query the server if you explicitly include them in the object attribute list to retrieve

Some LDAP servers like Redhat Directory Server support server-side sorting so you can also use these attributes as your sort criteria. On a large directory deployment , you should make sure that server indexes are created for these attributes to achieve reasonable query performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM