Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > CSVDE filter

Reply
 
 
Fat Frog
Guest
Posts: n/a

 
      01-19-2010
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.

 
Reply With Quote
 
 
 
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      01-19-2010

"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
--


 
Reply With Quote
 
Fat Frog
Guest
Posts: n/a

 
      01-19-2010
"Richard Mueller [MVP]" <rlmueller-> wrote in
message news:...
>
> "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
> --


Thank you so much! The result is exactly what I am looking for.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the different for PNPDTest between WLK 1.5 and WLK 1.2 Wayne Windows Vista Drivers 2 01-18-2010 08:32 PM
Re: File system filter driver: WDF or WDM? Don Burn Windows Vista Drivers 1 12-15-2009 05:16 PM
Programatically install a device filter driver marohn Windows Vista Drivers 0 12-09-2009 02:01 AM
Re: Unable to unload driver in Win 7 Tim Roberts Windows Vista Drivers 2 12-08-2009 12:24 PM
Re: Can filter driver ignore an AddDevice? Scott Noone Windows Vista Drivers 0 11-18-2009 03:43 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59