Solved

LDAP Querie to list names of user's in Group

Posted on 2013-05-10
7
470 Views
Last Modified: 2014-07-25
Hi

I'm new to LDAP in active Directory and need simple query to list users in a group.
Tryed to build querie in the (Saved Queries) in Management Coonsole 3.0 and it will not display. Could someone build me a simple querie that all I have to do is just change the name of the group.

Thanks..
0
Comment
Question by:dosuser
  • 3
  • 3
7 Comments
 
LVL 16

Expert Comment

by:cantoris
ID: 39158202
How about this:
(&(objectCategory=user)(memberOf=CN=YourGroupName,OU=YourOU,DC=YourDomain,DC=com))

Open in new window

0
 

Author Comment

by:dosuser
ID: 39164849
Thanks, I Tryed but didn't work. Would it be Group first then Members? (No one listed in memberof) when I run with AD and look in the group. Not sure what (OU=??) is used for. Thanks..
0
 
LVL 16

Expert Comment

by:cantoris
ID: 39166175
It works for me as an LDAP Query.
You need to add the Distinguished Name of the group you want to query after "memberOf=".

For example, the following works on my test machine:
"(&(objectCategory=user)(memberOf=CN=Domain Admins,CN=Users,DC=contoso,DC=local))"

If you don't understand what a Distinguished Name is, look here:
http://www.selfadsi.org/ldap-path.htm

Note that in Active Directory Users and Computers, with "Advanced Features" enabled on the View menu, then you can use the "Attribute Editor" tab on the properties sheet of your Group to view the Distinguished Name.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 16

Expert Comment

by:cantoris
ID: 39166185
Reading your question again, can't you just view the Group's MemberOf tab to get the info you need rather than write a query??

If I create an Advanced Custom Search type Query in AD, then I can paste in the LDAP Query I gave you above (minus the inverted commas) and it works fine.
0
 

Accepted Solution

by:
dosuser earned 0 total points
ID: 39172310
Thanks for pointing me in the right direction. This is what I put together to get this to work. The resign I needed it in a Query is that then it could be exported to CVS file to review for eliminating overlapping groups.
(memberOf:1.2.840.113556.1.4.1941:=CN=”Your_Nane_of_Your_Group”=Groups,OU=Users,OU=”Name of the Sever”,DC=com)

Thanks
0
 

Author Closing Comment

by:dosuser
ID: 39274175
Found My own Solution, Thanks for the pointers
0
 
LVL 17

Expert Comment

by:Spike99
ID: 40219274
For, me I couldn't get this to work until I put the full distinguished name of the group. Thanks for the help, cantoris:

(&(objectCategory=user)(memberOf=CN=GROUP_NAME,OU=MyOU1,OU=MyOU2,OU=MyOU3,DC=DomainName,DC=com))

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question