I've figured this out myself, here is the query.
ds.Filter = "(&(objectCategory=organizationalUnit)(l=*))";
Since AD properties are dictionary object.
George
Quote:
quote:Originally posted by georgeh
I would like to search all the "user definded" folder in my active directory. Here is my LDAP filter.
//=====================
DirectoryEntry searchroot = new DirectoryEntry(ConfigurationSettings.AppSettings["ADsSearchRoot"]);
DirectorySearcher ds = new DirectorySearcher(searchroot);
ds.SearchScope = SearchScope.Subtree;
ds.Filter = "(&(objectCategory=organizationalUnit)(l=??))" ;
SearchResultCollection results = ds.FindAll();
//=====================
Here 'l' means "city"... I would like to list out all the "user definded" folders which has characters in the "city" field...(the city field is not empty).
Can any of you teach me how to do that? Thanks
George
|