25112
asked on
combine dsquery and order the results
in sql we may do something like
SELECT NAME FROM TABLE
WHERE NAME LIKE '%POS%DEV%' OR NAME LIKE '%DEV%DEP%' OR NAME LIKE '%PSR%DEV%' ORDER BY NAME DESC
can we combine the following three into one statement
dsquery * -filter "(&(objectcategory=compute r)(name=*P OS*DEV*))" -attr name
dsquery * -filter "(&(objectcategory=compute r)(name=*D EV*DEP*))" -attr name
dsquery * -filter "(&(objectcategory=compute r)(name=*P SR*DEV*))" -attr name
SELECT NAME FROM TABLE
WHERE NAME LIKE '%POS%DEV%' OR NAME LIKE '%DEV%DEP%' OR NAME LIKE '%PSR%DEV%' ORDER BY NAME DESC
can we combine the following three into one statement
dsquery * -filter "(&(objectcategory=compute
dsquery * -filter "(&(objectcategory=compute
dsquery * -filter "(&(objectcategory=compute
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Unfortunately DS Tools doesn't allow for that :) They are old-fashioned tools. I would suggest to use for that Quest PowerShell module for AD. It's completely free and can be downloaded from
http://www.quest.com/powershell/activeroles-server.aspx
and use LDAP syntax
Get-QADComputer -LdapFilter "(&(objectCategory=compute r)(|(name= *POS*DEV*) (name=*DEV *DEP*)(nam e=*PSR*DEV *)))" | select name | Sort-Object name
Krzysztof
http://www.quest.com/powershell/activeroles-server.aspx
and use LDAP syntax
Get-QADComputer -LdapFilter "(&(objectCategory=compute
Krzysztof
ASKER
OK- thanks for explaining..
Get-QADComputer does not work for me, is it not part of win os like dsquery?
Get-QADComputer does not work for me, is it not part of win os like dsquery?
Nope, as I wrote you need for that Quest PowerShell module for AD (separate PowerShell download). It's completely free but you need local administrative privileges to install it on your workstation
Krzysztof
Krzysztof
ASKER
thank you Krzysztof for sharing your knowledge
No problem, you're welcome :)
Krzysztof
Krzysztof
ASKER