rajachan_05
rajachan_05

Reputation: 21

Retrieve users created between two dates from ldap

Can someone help me how to use the filter conditions to fetch user lists created between two dates(from and to dates) from LDAP in java . In ldap date is shown in DD-MON-YYYY however on searching with (dateattr=09-JAN-2019) for example returns 0 results

Upvotes: 0

Views: 2247

Answers (1)

jwilleke
jwilleke

Reputation: 10986

Date (GeneralizedTime) LDAP SearchFilters shows how to Match any dates Greater than or equal to 20190101000000Z but less than or equal to 20200101500000Z

ldapsearch -D "cn=exampleuser,example.com" -w secret -p 389 -h server.example.com -b "dc=example,dc=com" -s sub "(&(createTimestamp>=20190101000000Z)(createTimestamp<=20200101500000Z))" 

Upvotes: 3

Related Questions