Results 1 to 2 of 2

Thread: dsquery to list members of group

  1. #1
    joey Guest

    dsquery to list members of group

    how do I use dsquery to list all members of a group?



  2. #2
    Richard Mueller [MVP] Guest

    Re: dsquery to list members of group

    joey wrote:

    > how do I use dsquery to list all members of a group?
    >


    Command line tools like dsquery are difficult to use. If it can be done with
    dsquery, I can't figure it out. I would suggest using Joe Richards' free
    adfind utility. See this link:

    http://www.joeware.net/freetools/tools/adfind/index.htm

    The syntax for finding all direct members of a group would be similar to:

    adfind -b dc=MyDomain,dc=com -f "(memberOf=cn=Test
    Group,ou=West,dc=MyDomain,dc=com)" dn

    The reasons this utility is so useful is that you can use standard LDAP
    filters and refer to attributes by their real names, rather than trying to
    remember some shortcut. If you want to see the sAMAccountName's of the
    members, add that attribute at the end. If you want to restrict the members
    to user objects (not groups or computers), adjust the filter. For example
    (watch line wrapping, this is one line):

    adfind -b dc=MyDomain,dc=com -f
    "(&(objectCategory=person)(objectClass=user)(memberOf=cn=Test
    Group,ou=West,dc=MyDomain,dc=com))" dn sAMAccountName

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --



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:59 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:05 PM
  3. Replies: 2
    Last Post: 28-02-2010, 08:00 PM
  4. Using DSQUERY to get the members of a Group in AD
    By sevaanan in forum Active Directory
    Replies: 5
    Last Post: 11-11-2009, 01:23 PM
  5. Dsget group members SID
    By Jeremy Smith in forum Active Directory
    Replies: 3
    Last Post: 22-11-2008, 06:02 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,638,712,190.55212 seconds with 17 queries