"Fat Frog" <> wrote in message
news:utgG%...
> Hello,
>
> I use csvde.exe to query Active Directory user's first name, last name,
> logon name. The result gives me 2000 entries of all users in the domain,
> but I only need less than 100 of them that were created since, say, last
> month. I am wondering how I would put a filter on the -L of CSVDE.
>
> I run it like this:
> csvde -d "ou=DomainUsers,DC=domain,DC=org" -r objectClass=user -L
> "sAMAccountName,givenName,sn,whenCreated"
>
> The query result listed under the LDAP label of whenCreated is in the
> format of 20100112172907.0Z ("2010-01-12 17:29:07 0Z could be time zone
> designation).
>
> It doesn't matter to filter according to the value of numbers or the past
> dates, I just need the result that only contains the newly added active
> directory users.
>
> Thanks and regards.
You can include a whenCreated clause in your filter. For example (watch line
wrapping):
csvde -d "ou=DomainUsers,DC=domain,DC=org" -r
"(&(objectCategory=person)(objectClass=user)(whenC reated>=20100101000000.0Z))"
-L "sAMAccountName,givenName,sn,whenCreated" -f report.csv
The form of the clause is:
(whenCreated>=yyyymmddhhmmss.0Z)
I believe the ">" operator is not supported, so use ">=". I added the
objectCategory clause to eliminate computer objects (which also are class
user). The ".0Z" will be UTC (what used to be called GMT).
--
Richard Mueller
MVP Directory Services
Hilltop Lab -
http://www.rlmueller.net
--