TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Windows Server 2003

Notices

dsquery filter

Windows Server 2003


Reply
 
Thread Tools Display Modes
Old 10-02-2008, 06:57 PM   #1
Björn
Guest
 
Posts: n/a
dsquery filter

Hello!

I have the following question:

I want to use dsquery to get all users in a specified OU who are members
of an given group.

I try it so:

dsquery * "OU=OU1,OU=Accounts,DC=domain,DC=local" -attr name memberOf
-filter "(memberOf=*ocsgrp*)"

The result set is always empty. I expect 3 users.

Whats wrong?

Many thanks!!
  Reply With Quote
Old 10-02-2008, 06:57 PM   #2
Richard Mueller [MVP]
Guest
 
Posts: n/a
Re: dsquery filter

Björn wrote:

> I have the following question:
>
> I want to use dsquery to get all users in a specified OU who are members
> of an given group.
>
> I try it so:
>
> dsquery * "OU=OU1,OU=Accounts,DC=domain,DC=local" -attr name
> memberOf -filter "(memberOf=*ocsgrp*)"
>
> The result set is always empty. I expect 3 users.
>
> Whats wrong?


You must specify the full Distinguished Name of the group in the filter
clause. Wildcards don't work. Something like:

-filter (memberOf=cn=ocsgrp,OU=OU1,OU=Accounts,DC=domain,D C=local)

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


  Reply With Quote
Reply

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 06:42 AM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional