2 kinds of dsquery results

i ran
dsquery * -filter "(&(objectcategory=computer)(name=*DEV*))" -attr name
and then
dsquery computer -limit 0 | find /i "DEV"

 the latter is more complete.. the first one does not show it all.. what is the reason?
in the second one, can we just have the name print like in the first one?
Who is Participating?
Krzysztof PytkoConnect With a Mentor Senior Active Directory EngineerCommented:
Please notice, that you use for search (in second case) FIND which searches for "DEV" in whole line, not only for computer's name. That;s the difference :)

Personally, I would rely on the first syntax (it's much more accurate for me) but if you wish, you may try to check this syntax

dsquery computer -name * -limit 0 | dsget computer -samid | find /i "DEV"

now, you should see better output and results should be similar to the first syntax :)

If you wish, you may read some more about DS Tools on my blog at

There is a serie of them beginning from part 1 to part 4 (it's not finnished yet ;) )

25112Author Commented:
thanks Krzysztof. the write up is a great reference.. thanks for the hard work.

the third query, is so slow:
dsquery computer -name * -limit 0 | dsget computer -samid | find /i "DEV"

but for obvious reasons..

helps to confirm the point..
Krzysztof PytkoSenior Active Directory EngineerCommented:
You're welcome :)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.