Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

proper way to query active directory by whenCreated

Status
Not open for further replies.

tperri

Programmer
Apr 8, 2006
728
US
Hello everyone,

I'm trying to get a list of users created within the past 2 days in Active Directory.

here is my search filter:

Code:
search.Filter = "(&(objectClass=user)(objectCategory=person))";

This is what I think I'm aiming for:
Code:
search.Filter = "(&(objectClass=user)(objectCategory=person)(whenCreated='4/22/2008 12:00:00 AM'))";

However I'm getting an error stating I have invalid filter criteria. Do I need to convert the date time to a different format to oass into my query? In the properties I receive back, the DateTime is in the format I am trying to pass to my query.

All help is appreciated with this - thank you in advance!

~t
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top