RE: [ActiveDir] DSQUERY filter for space character only

2006-02-08 Thread Sitton Glen E




Thanks Joe. I did use that MSDN article before I posted, but it didn't list the escape 
sequence for the space character. Knowing what I know now, I probably 
should have pieced it together consideringthat %20 is the space character 
in a URL.

Interesting that'user' is not a valid 
objectcategory. When I had ADUC create the query for me, it automatically 
generated the filter that included objectCategory=user. New Query / Custom Search / 
then Display Name Is Exactly (space character). 



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
joeSent: Tuesday, February 07, 2006 5:39 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only

The tricky piece here is the space, the displayname=\20 
mechanism would work as well as the very cute little query Dean posted of 
displayname=!. Check out http://msdn.microsoft.com/library/default.asp?url="">. 
It talks a little about constructing queries.

The other thing that stuck out to me appears to have stuck 
out to you is the fact that everyone was using objectcategory=user. The user 
class isn't a valid objectcategory. Luckily AD figures that out for you and 
changes the query to objectcategory=person. However, that may not be the query 
the OP wanted because that will return matching users and contacts. 


Since displayname is indexed, you could probably get away 
with the query ((objectclass=user)(displayname=\20)). The tried and true 
test would be to submit that query up against 
((objectcategory=person)(objectclass=user)(displayname=\20)) or even 
((sAMAccountType=805306368)(displayname=\20)) with the STATS control and 
see what indexes get used, I would expect displayName 
generally.

I just did a trace and took a peek and the displayname=" " 
doesn't even get to the server, the client dumps it as a bad query before 
then.



--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm




From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of David 
AragonSent: Tuesday, February 07, 2006 2:19 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only

Have you tried:

((objectCategory=Person)(objClass=User)(displayName=\\ 
))

David AragonYour ability to perceive a solution is 
limitedonly by your understanding of the problem 


  
  
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
  ESent: Tuesday, February 07, 2006 9:17 AMTo: 
  ActiveDir@mail.activedir.orgSubject: [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
  


RE: [ActiveDir] DSQUERY filter for space character only

2006-02-08 Thread Dean Wells



 
Interesting 
that'user' is not a valid objectcategory. When I had ADUC create the 
query for me, 
 it 
automatically generated the filter that included objectCategory=user. New Query / Custom 

 Search / 
then Display Name Is Exactly (space 
character).

The attribute "objectCategory" is of syntax 
distinguishedName and naturally requires a syntactically compatible value. 
AD, however,is smart enough to take a non-DN value for objectCategory and 
derive a DN from it, assuming the constructed DN results in a viable schema 
entry, AD then reads the value of the resulting object's defaultObjectCategory 
propertyand substitutes the original query-value with the 
defaultObjectCategory value thereby permitting the query to proceed without 
error.

e.g. if the filter provided contains 
"((objectCategory=user)(sn=wells))" 
-

1. construct DN
- 
cn=user,cn=schema,cn=configuration,dc=mset,dc=local
2. read DN's defaultObjectCategory 
value
 - 
CN=Person,CN=Schema,CN=Configuration,DC=mset,DC=local
3. modify original query and execute, resulting query 
-
 - 
"((objectcategory=CN=Person,CN=Schema,CN=Configuration,DC=mset,DC=local)(sn=wells))"

... in truth, it's not quite what you asked for ... but 
since (technically speaking) you asked for it incorrectly, it gives you 
something close:o)

--Dean WellsMSEtechnology* Email: dwells@msetechnology.comhttp://msetechnology.com



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
ESent: Wednesday, February 08, 2006 1:06 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only


Thanks Joe. I did use that MSDN article before I posted, but it didn't list the escape 
sequence for the space character. Knowing what I know now, I probably 
should have pieced it together consideringthat %20 is the space character 
in a URL.

Interesting that'user' is not a valid 
objectcategory. When I had ADUC create the query for me, it automatically 
generated the filter that included objectCategory=user. New Query / Custom Search / 
then Display Name Is Exactly (space character). 



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
joeSent: Tuesday, February 07, 2006 5:39 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only

The tricky piece here is the space, the displayname=\20 
mechanism would work as well as the very cute little query Dean posted of 
displayname=!. Check out http://msdn.microsoft.com/library/default.asp?url="">. 
It talks a little about constructing queries.

The other thing that stuck out to me appears to have stuck 
out to you is the fact that everyone was using objectcategory=user. The user 
class isn't a valid objectcategory. Luckily AD figures that out for you and 
changes the query to objectcategory=person. However, that may not be the query 
the OP wanted because that will return matching users and contacts. 


Since displayname is indexed, you could probably get away 
with the query ((objectclass=user)(displayname=\20)). The tried and true 
test would be to submit that query up against 
((objectcategory=person)(objectclass=user)(displayname=\20)) or even 
((sAMAccountType=805306368)(displayname=\20)) with the STATS control and 
see what indexes get used, I would expect displayName 
generally.

I just did a trace and took a peek and the displayname=" " 
doesn't even get to the server, the client dumps it as a bad query before 
then.



--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm




From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of David 
AragonSent: Tuesday, February 07, 2006 2:19 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only

Have you tried:

((objectCategory=Person)(objClass=User)(displayName=\\ 
))

David AragonYour ability to perceive a solution is 
limitedonly by your understanding of the problem 


  
  
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
  ESent: Tuesday, February 07, 2006 9:17 AMTo: 
  ActiveDir@mail.activedir.orgSubject: [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
  


RE: [ActiveDir] DSQUERY filter for space character only

2006-02-08 Thread joe



Yeah, they didn't list every possible character in that 
article, only a few of them that you *always* have to escape. A space can make 
it through fine as long as it isn't the intial character (or characters) as the 
API call trims the string of initial whitespace. The funny thing about that is 
that I previously bugged a problem where they *don't* trim the whitespace on the 
end of a query so if you have something like "FALSE " for a boolean value, it 
will fail. The response from MS when I bugged it was that to them, they have to 
treat a space as any normal character and can't do anything special with it. 
When I pointed out that they did it for spaces in front of something else they 
didn't respond. I think I might try to reopen that bug and push it some more. 


Anyway, they sort of cover that case with line under the 
chart "In addition, arbitrary binary data may be 
represented using the escape sequence syntax by encoding each byte of binary 
data with the backslash followed by two hexadecimal digits.". Since any 
data you send for a string could be handled as binary data A=65,a=97, etc they 
covered themselves. There are actually some fun issues around this that I have 
seen several companies run into when writing queries to find home drives on 
servers with names that start with A-F. I actually bugged that as well because I 
think it is handled incorrectly but that is another story.


As an FYI, I did bug the ADUC issues with the query 
generation for the custom filter for Users and Contacts as well as the issue 
with the space. The filters absolutely aren't right and ADUC should produce them 
correctly. Recall that ADUC is simply someone's interpretation of how AD should 
be represented in GUI form. Things in there and things it produces can not be 
looked at as being the definition of correct. What it does could be correct, but 
it could just as easily be incorrect as well. One generally hopes for it to be 
more correct than not. 

Dean explained what happens with objectcategory. I will 
give an explicit example of how to show that is happening and how user truly 
isn't valid as an objectcategory.

First to see it happening, use the STATS control and do any 
query of objectcategory=user, or any objectcategory=anyldapdisplayname, you will 
see the resulting query will look like


C:\WINDOWS\ADAMadfind -default -f 
objectcategory=user -stats+only

AdFind V01.31.00cpp Joe Richards ([EMAIL PROTECTED]) 
February 2006

Using server: 2k3dc01.joe.com:389Directory: Windows 
Server 2003Base DN: DC=joe,DC=com



Statistics=Elapsed 
Time: 171 (ms)Returned 7142 entries of 7160 visited - 
(99.75%)

Used 
Filter:(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=joe,DC=com)

Used 
Indices:idx_objectCategory:4660:N

Analysis-Hit Rate of 99.75% is 
Efficient

Indices 
used:

Index 
Name : idx_objectCategoryRecord Count: 4660 (estimate)Index 
Type : Normal Attribute Index

Filter 
Breakdown:

(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=joe,DC=com)


Now try a 
query of 
objectcategory=cn=user,CN=Schema,CN=Configuration,DC=joe,DC=com

That same 
lookup on defaultObjectCategory doesn't occur because it assumes since you 
specified an actual DN (the proper format) you know exactly what you want 



C:\WINDOWS\ADAMadfind -default -f 
objectcategory=CN=User,CN=Schema,CN=Configuration,DC=joe,DC=com 
-stats+only

AdFind V01.31.00cpp Joe Richards ([EMAIL PROTECTED]) 
February 2006

Using 
server: 2k3dc01.joe.com:389Directory: Windows Server 2003Base DN: 
DC=joe,DC=com



Statistics=Elapsed Time: 0 
(ms)WARN: If this is pre-SP1 Windows Server 2003, there is a bug for entries 
visited/returnedReturned 0 entries of 0 visited - 
(0.00%)

Used 
Filter:(objectCategory=CN=User,CN=Schema,CN=Configuration,DC=joe,DC=com)

Used 
Indices:idx_objectCategory:0:N

Analysis-Hit Rate of 0.00% 
is Inefficient

Indices 
used:

Index Name 
: idx_objectCategoryRecord Count: 0 (estimate)Index Type : 
Normal Attribute Index

Filter 
Breakdown:

(objectCategory=CN=User,CN=Schema,CN=Configuration,DC=joe,DC=com)


 joe



--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm




From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
ESent: Wednesday, February 08, 2006 1:06 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only


Thanks Joe. I did use that MSDN article before I posted, but it didn't list the escape 
sequence for the space character. Knowing what I know now, I probably 
should have pieced it together consideringthat %20 is the space character 
in a URL.

Interesting that'user' is not a valid 
objectcategory. When I had ADUC create the query for me, it automatically 
generated the filter that included objectCategory=user. New Query / Custom Search / 
then Display Na

Re: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Mark Parris
What's the query for? Can you not query on all objects then export to excel or 
word and look for the spaces? Crude but it should work.

Mark

-Original Message-
From: Sitton Glen E [EMAIL PROTECTED]
Date: Tue, 7 Feb 2006 11:16:53 
To:ActiveDir@mail.activedir.org
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 
 
List info   : http://www.activedir.org/List.aspx
List FAQ: http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/


RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Olivarez, Sergio J Mr ANOSC/FCBS








Have you tried * *





Thanks...
... ... ...

Sergio J.
Olivarez













From: Sitton Glen E
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
10:17 AM
To: ActiveDir@mail.activedir.org
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
















RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Gilbert, Daniel L Mr ANOSC/FCBS








You follow this list?











From: Olivarez, Sergio
J Mr ANOSC/FCBS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
11:23 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] DSQUERY
filter for space character only





Have you tried * *





Thanks...
... ... ...

Sergio J.
Olivarez













From: Sitton Glen E
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
10:17 AM
To: ActiveDir@mail.activedir.org
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
















RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Sitton Glen E
Title: RE: [ActiveDir] DSQUERY filter for space character only





Some automated process has thrown a single space character into the
displayName and I'm hoping to construct a simple DSQUERY to find them
and then fix them. 


Yes, the workaround you describe is pretty much what I am doing in lieu
of a DSQUERY filter. It's just a pain because there are over 100,000
user accounts. I am dumping the values to a temp file, then querying it
in a secondary process. 



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Mark Parris
Sent: Tuesday, February 07, 2006 11:57 AM
To: ActiveDir.org
Subject: Re: [ActiveDir] DSQUERY filter for space character only


What's the query for? Can you not query on all objects then export to
excel or word and look for the spaces? Crude but it should work.


Mark


-Original Message-
From: Sitton Glen E [EMAIL PROTECTED]
Date: Tue, 7 Feb 2006 11:16:53
To:ActiveDir@mail.activedir.org
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 

List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/





RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Gil Kirkpatrick



That will only work on appropriately indexed 
attributes.

Try \20. That would be the appropriate escaped 
filter.

-gil


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Olivarez, Sergio 
J Mr ANOSC/FCBSSent: Tuesday, February 07, 2006 11:23 
AMTo: ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] 
DSQUERY filter for space character only


Have you tried * 
*


Thanks... 
... ... ...
Sergio J. 
Olivarez





From: Sitton 
Glen E [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 07, 2006 10:17 
AMTo: 
ActiveDir@mail.activedir.orgSubject: [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




RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Olivarez, Sergio J Mr ANOSC/FCBS








Been using the archive for a while, but I
just subscribed yesterday!





Thanks...
... ... ...

Sergio J.
Olivarez













From: Gilbert, Daniel
L Mr ANOSC/FCBS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
11:28 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] DSQUERY
filter for space character only





You follow this list?











From: Olivarez, Sergio
J Mr ANOSC/FCBS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
11:23 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] DSQUERY
filter for space character only





Have you tried * *





Thanks...
... ... ...

Sergio J.
Olivarez













From: Sitton Glen E
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
10:17 AM
To: ActiveDir@mail.activedir.org
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
















RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Dean Wells



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 WellsMSEtechnology* Email: dwells@msetechnology.comhttp://msetechnology.com



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
ESent: Tuesday, February 07, 2006 12:17 PMTo: 
ActiveDir@mail.activedir.orgSubject: [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



RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Coleman, Hunter



(objectCategory=user)(displayName=\20))


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
ESent: Tuesday, February 07, 2006 10:17 AMTo: 
ActiveDir@mail.activedir.orgSubject: [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



RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Gilbert, Daniel L Mr ANOSC/FCBS








Cool, buckle up, lots of very smart folks
here (not me K) you will see lots of chances to learn.



Dan











From: Olivarez, Sergio
J Mr ANOSC/FCBS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
11:39 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] DSQUERY
filter for space character only





Been using the archive for a while, but I
just subscribed yesterday!





Thanks...
... ... ...

Sergio J.
Olivarez













From: Gilbert, Daniel
L Mr ANOSC/FCBS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
11:28 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] DSQUERY
filter for space character only





You follow this list?











From: Olivarez, Sergio
J Mr ANOSC/FCBS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
11:23 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] DSQUERY
filter for space character only





Have you tried * *





Thanks...
... ... ...

Sergio J.
Olivarez













From: Sitton Glen E
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006
10:17 AM
To: ActiveDir@mail.activedir.org
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
















RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread Sitton Glen E



Thank you Gil, Dean, Hunter. That works 
perfectly. 


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Coleman, 
HunterSent: Tuesday, February 07, 2006 12:48 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only

(objectCategory=user)(displayName=\20))


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
ESent: Tuesday, February 07, 2006 10:17 AMTo: 
ActiveDir@mail.activedir.orgSubject: [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



RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread David Aragon



Have you tried:

((objectCategory=Person)(objClass=User)(displayName=\\ 
))

David AragonYour ability to perceive a solution is 
limitedonly by your understanding of the problem 


  
  
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
  ESent: Tuesday, February 07, 2006 9:17 AMTo: 
  ActiveDir@mail.activedir.orgSubject: [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
  


RE: [ActiveDir] DSQUERY filter for space character only

2006-02-07 Thread joe



The tricky piece here is the space, the displayname=\20 
mechanism would work as well as the very cute little query Dean posted of 
displayname=!. Check out http://msdn.microsoft.com/library/default.asp?url="">. 
It talks a little about constructing queries.

The other thing that stuck out to me appears to have stuck 
out to you is the fact that everyone was using objectcategory=user. The user 
class isn't a valid objectcategory. Luckily AD figures that out for you and 
changes the query to objectcategory=person. However, that may not be the query 
the OP wanted because that will return matching users and contacts. 


Since displayname is indexed, you could probably get away 
with the query ((objectclass=user)(displayname=\20)). The tried and true 
test would be to submit that query up against 
((objectcategory=person)(objectclass=user)(displayname=\20)) or even 
((sAMAccountType=805306368)(displayname=\20)) with the STATS control and 
see what indexes get used, I would expect displayName 
generally.

I just did a trace and took a peek and the displayname=" " 
doesn't even get to the server, the client dumps it as a bad query before 
then.



--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm




From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of David 
AragonSent: Tuesday, February 07, 2006 2:19 PMTo: 
ActiveDir@mail.activedir.orgSubject: RE: [ActiveDir] DSQUERY filter 
for space character only

Have you tried:

((objectCategory=Person)(objClass=User)(displayName=\\ 
))

David AragonYour ability to perceive a solution is 
limitedonly by your understanding of the problem 


  
  
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen 
  ESent: Tuesday, February 07, 2006 9:17 AMTo: 
  ActiveDir@mail.activedir.orgSubject: [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