Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Chris Whittle
Active Directory Search Filter Question
August 4, 2010 7:47 AM
Answer

Chris Whittle

Rank: Expert

Posts: 462

Join Date: September 17, 2008

Recent Posts

I have attributes in AD that have spaces in them... For example the mail attribute is just a space... I want to put this in my filter to ignore those but can't seem to get the right logic down...
Here is my original filter
1(&(objectClass=user)(mail=*))

Any ideas?
Scott Palmer
RE: Active Directory Search Filter Question
August 8, 2010 5:02 PM
Answer

Scott Palmer

Rank: Junior Member

Posts: 36

Join Date: January 8, 2010

Recent Posts

You want to ignore users that have a space in any of their attributes or you just want to ignore users that have a space in their email?
Chris Whittle
RE: Active Directory Search Filter Question
August 8, 2010 6:22 PM
Answer

Chris Whittle

Rank: Expert

Posts: 462

Join Date: September 17, 2008

Recent Posts

Just where the mail attribute is a space..
Hubert Felber
RE: Active Directory Search Filter Question
August 10, 2010 7:04 AM
Answer

Hubert Felber

Rank: Regular Member

Posts: 157

Join Date: November 23, 2009

Recent Posts

Chris Whittle:

1(&(objectClass=user)(mail=*))

Any ideas?
try this
(&(objectClass=user)(!(mail=* *)))
should ignore any mail addresses containing a space

(&(objectClass=user)(!(mail=* *)) ((mail=*)))

should return users with a mail attribute set but not containing space

hth
Hubert
Scott Palmer
RE: Active Directory Search Filter Question
August 11, 2010 12:53 AM
Answer

Scott Palmer

Rank: Junior Member

Posts: 36

Join Date: January 8, 2010

Recent Posts

Thanks Hubert.

On a related note I've found Apache Directory Studio useful for testing / validating LDAP filters.
Chris Whittle
RE: Active Directory Search Filter Question
August 12, 2010 6:10 AM
Answer

Chris Whittle

Rank: Expert

Posts: 462

Join Date: September 17, 2008

Recent Posts

Thanks Hubert you are the man! That worked perfect...
Chris Whittle
RE: Active Directory Search Filter Question
August 12, 2010 6:10 AM
Answer

Chris Whittle

Rank: Expert

Posts: 462

Join Date: September 17, 2008

Recent Posts

Thanks Scott I will take a look at it!