Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LDAP search - modifyTimeStamp

4,874 views
Skip to first unread message

RC

unread,
Jun 23, 2008, 1:42:09 PM6/23/08
to
using LDIFDE or ADFIND

im trying to search against the modifytimestamp attribute but would
like to search between specific dates. every time i try to search i
get a "filter error" and it because of the modifytimestamp and how i
am using the value. how exactly should i throw it together


(&(objectcategory=person)(objectclass=user)(modifyTimeStamp=?????))

i want to search for say between two dates example: june8 - jun15
using the follow attribute.

DP133091

unread,
Jun 23, 2008, 2:36:00 PM6/23/08
to
The format is UTC coded time
(&(objectcategory=person)(objectclass=user)(modifyTimeStamp>=20080622213036.Z))should
work to find anything after 6/23/2008 13:03:36. I should warn you but this
attribute is not a replicated attribute. So to get the most current you need
to pull this from all domain controllers. Hope this helps.

Richard Mueller [MVP]

unread,
Jun 23, 2008, 2:39:09 PM6/23/08
to
RC wrote:

You can use the operators ">=" or "<=" but not ">" or "<". For example
(watch line wrapping, this is one line):

(&(objectCategory=person)(objectClass=user)(modifyTimeStamp>=20080608000000.0Z)(modifyTimeStamp<=20080615000000.0Z))

Note that GeneralizedTime attributes, like modifyTimeStamp, require the
format yyyymmddhhmmss.0Z for date/times in UTC. If you want to specify the
time in your time zone and your time zone bias is +200, then you can use:

(&(objectCategory=person)(objectClass=user)(modifyTimeStamp>=20080608000000.0+0200)(modifyTimeStamp<=20080615000000.0+0200))

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


RC

unread,
Jun 23, 2008, 3:32:28 PM6/23/08
to
On Jun 23, 2:36 pm, DP133091 <DP133...@discussions.microsoft.com>
wrote:

> The format is UTC coded time
> (&(objectcategory=person)(objectclass=user)(modifyTimeStamp>=20080622213036­.Z))should

> work to find anything after 6/23/2008 13:03:36. I should warn you but this
> attribute is not a replicated attribute. So to get the most current you need
> to pull this from all domain controllers. Hope this helps.
>
>
>
> "RC" wrote:
> > using LDIFDE or ADFIND
>
> > im trying to search against the modifytimestamp attribute but would
> > like to search between specific dates. every time i try to search i
> > get a "filter error" and it because of the modifytimestamp and how i
> > am using the value. how exactly should i throw it together
>
> > (&(objectcategory=person)(objectclass=user)(modifyTimeStamp=?????))
>
> > i want to search for say between two dates example: june8 - jun15
> > using the follow attribute.- Hide quoted text -
>
> - Show quoted text -

Interesting. I just noticed this. Hmmm

I guess i can use the above lday query with the whenChanged attribute
to accomplish this since this attributed is replicated.

Richard Mueller [MVP]

unread,
Jun 23, 2008, 6:19:13 PM6/23/08
to

"RC" <RichJC...@gmail.com> wrote in message
news:fa0b048a-710e-4256...@m45g2000hsb.googlegroups.com...

-------------

Hmmm. I see modifyTimeStamp as replicated, but whenChanged is not (by
default). However, modifyTimeStamp is operational (sometimes called
constructed), so the value won't be in the property cache. However, I find
this doesn't matter if you use ADO in VBScript or adfind. I just tested with
adfind and it seems to work fine.

0 new messages