Solved

LDAP Querie to list names of user's in Group

Posted on 2013-05-10
7
457 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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 16

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

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Know what services you can and cannot, should and should not combine on your server.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now