Results 1 to 6 of 6

Thread: Using DSQUERY to get the members of a Group in AD

  1. #1
    Join Date
    Oct 2005
    Posts
    67

    Using DSQUERY to get the members of a Group in AD

    I need to query members of Specific group in Active Directory and I need to do it using SQUERY command line tool. As I’m not so good in SQUERY can anyone please provide me correct syntax to use the same? Let me tell you that I have already tried few combinations such as “dsquery user OU=xxx, DC=yyy,DC=ZZZ” but none of them worked so far for me.

    Somebody also suggested me to run dsquery group method, I ran but that too dint helped. So I need help from you all.

  2. #2
    Join Date
    Sep 2004
    Posts
    140

    RE: Using DSQUERY to get the members of a Group in AD

    Here is the proper way of doing the same.

    C:\>dsget group "CN=GroupName,DC=domain-name,DC=com" -members
    If you need to specify a server and/ or credentials, append the following on the end like this:

    -s dc01 -u userName -p *

  3. #3
    Join Date
    Oct 2005
    Posts
    67
    Thanks a lot Stuartl. That Perfect

    No problem! :-)

    What command are you typing?

    dsget group "CN=Group,CN=users,DC=domain,DC=ca" -members

  4. #4
    Join Date
    Oct 2005
    Posts
    67

    Re: Using DSQUERY to get the members of a Group in AD

    Hey, i think there is something wrong with me. I'm running the same command as you suggested but it ends up saying

    dsget failed:A referral was returned from the server.
    Any ideas what this is?

  5. #5
    Join Date
    Sep 2004
    Posts
    150

    Re: Using DSQUERY to get the members of a Group in AD

    Are you sure you ran the correct command because the one mentioned above seems perfect to me as well. I am not getting why it is not working for you. Are you sure your domain is different to your DNS domain?

    Try the same thing with adfind

    adfind -b cn=group,cn=users,dc=domain-name,dc=com member -nodn

  6. #6
    Join Date
    Nov 2009
    Posts
    1

    Re: Using DSQUERY to get the members of a Group in AD

    Hi Paul,

    Sorry, Can you help me to give a dsquery command to get all inactive domain clients from specific OU?

    Thanks,
    Nap

Similar Threads

  1. Listing members of Group with >1500 members
    By Umesh Thakur in forum Windows Server Help
    Replies: 11
    Last Post: 03-02-2012, 04:29 AM
  2. Display members of a group with more than 1500 members
    By Simon G in forum Windows Server Help
    Replies: 5
    Last Post: 25-10-2011, 12:35 PM
  3. Replies: 2
    Last Post: 28-02-2010, 07:30 PM
  4. dsquery to list members of group
    By joey in forum Windows Server Help
    Replies: 1
    Last Post: 05-11-2008, 07:43 AM
  5. Export Group Members
    By seankil in forum Windows Server Help
    Replies: 4
    Last Post: 09-04-2008, 09:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •