Discussion:
CSVDE filter
(too old to reply)
Fat Frog
2010-01-19 17:06:28 UTC
Permalink
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.
Richard Mueller [MVP]
2010-01-19 17:59:26 UTC
Permalink
Post by Fat Frog
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.
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)(whenCreated>=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
--
Fat Frog
2010-01-19 18:48:59 UTC
Permalink
Post by Richard Mueller [MVP]
Post by Fat Frog
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.
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
csvde -d "ou=DomainUsers,DC=domain,DC=org" -r
"(&(objectCategory=person)(objectClass=user)(whenCreated>=20100101000000.0Z))"
-L "sAMAccountName,givenName,sn,whenCreated" -f report.csv
(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
--
Thank you so much! The result is exactly what I am looking for.

Loading...