IIRC, the query processor barks at the use of values comprised entirely of spaces.  As such, use the following -
 
dsquery * dc=mset,dc=local -scope subtree -filter "(&(objectcategory=user)(displayname=\20))
 
... or for a more creative approach -
 
dsquery * dc=mset,dc=local -scope subtree -filter "(&(objectcategory=user)(displayname<=!))
 
Note that the latter will return any qualifying object whose displayName contains any number of spaces whereas the former's equality match is more literal.

--
Dean Wells
MSEtechnology
* Email: dwells@msetechnology.com

http://msetechnology.com

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen E
Sent: Tuesday, February 07, 2006 12:17 PM
To: [email protected]
Subject: [ActiveDir] DSQUERY filter for space character only

I need to run an obscure DSQUERY with a filter that finds displayNames with a value of a single space character.  I'm stumped.  I've tried every escape character possibility that I'm aware of.  I know how to find null values, but can't seem to query on a space character alone.  It hoses the ldap syntax.
 
When ADUC builds the ldap query itself, it fails:
 
    (&(objectCategory=user)(displayName= ))
 
    The query filter ... is not a valid query string.
 
I've tried:
    " "
    ' '
    %20
    +
 and escaping it with a \ or a ^
 
Any ideas?
 
Thanks in advance,
- Glen
 

Reply via email to