Mostrando entradas con la etiqueta ldif export timestamp query ldapsearch ldap search server. Mostrar todas las entradas
Mostrando entradas con la etiqueta ldif export timestamp query ldapsearch ldap search server. Mostrar todas las entradas

jueves, 11 de febrero de 2010

Ldap timestamp search

Hi there!!!
I had to produce an incremental ldif file from an ldap server. This file had to have all ldap entries modified from a certain date (for example 1st of Febrary 2010). But the issue was not as easy as it sounds, mainly because i had to guess what was the search string that provided a valid filter in order to get the desired results.
The format is as follows:
YYYYMMDDhhmmssZ
4 digit Year
2 digits Month
2 digits Day
2 digits hour
2 digits minute
2 digits second
End with "Z" char
Example:

ldapsearch -x -H ldaps://A.B.C.D:636 -D "cn=admin,o=demo" -W -b "ou=users,o=kasa" "modifyTimestamp>=20100201000000Z" >tst.ldif

I hope that it will be usefull for you.