Results 1 to 2 of 2

Thread: Ldap query to list groups a user is a member of?

  1. #1
    Join Date
    Jul 2006
    Posts
    182

    Ldap query to list groups a user is a member of?

    Can anyone tell me how to build a custom LDAP query, apart from vbs-ADSI scriptingm which can be used in Saved Queries in ADUC to list all groups a user is a member of? I have tried to use the below:

    (group=*)(&(user=User1)(MemberOf=*))

    Thanks for any suggestions.

  2. #2
    Join Date
    Jan 2006
    Posts
    3,792
    I think that you might need th full Distinguished Name of the user. The query can be same as like:

    (&(objectCategory=group)(member=cn=Jim
    Smith,ou=Sales,ou=West,dc=MyDomain,dc=com))

    It will then return all groups the specified user is a direct member of, except for the primary group of the user. When the user DN has an embedded comma, escape it with the backslash '\' escape character. For instance, check below:

    (&(objectCategory=group)(member=cn=Smith\,
    James,ou=Sales,ou=West,dc=MyDomain,dc=com))

Similar Threads

  1. LDAP query to speficied LDAP server on TCP port 389 failed
    By Shash in forum Windows Server Help
    Replies: 2
    Last Post: 02-05-2012, 05:01 PM
  2. Problem in binding the user in LDAP using Spring LDAP
    By deepti.agrawal in forum Software Development
    Replies: 1
    Last Post: 25-04-2011, 03:26 AM
  3. Domain Local Groups are not visible in member of tab
    By dipak_borole in forum Active Directory
    Replies: 1
    Last Post: 23-04-2011, 05:20 PM
  4. VB script - List all user groups Help
    By Daljeet in forum Software Development
    Replies: 4
    Last Post: 18-12-2008, 07:51 PM
  5. LDAP query can it be done ?
    By zscw1 in forum Active Directory
    Replies: 3
    Last Post: 13-11-2008, 10:08 AM

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,713,541,134.81069 seconds with 18 queries