Solved

LDAP Querie to list names of user's in Group

Posted on 2013-05-10
7
474 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
This collection of functions covers all the normal rounding methods of just about any numeric value.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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