Solved

LDAP Querie to list names of user's in Group

Posted on 2013-05-10
7
458 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
Will my email signature work in Office 365?

You've built an email signature using raw HTML code in Office 365, but you can't review how it looks with Transport Rules. So you have to test it over and over again before it can be used. Isn't this a bit of a waste of your time? Wouldn't a WYSIWYG editor make it a lot easier?

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Viewers will learn the different options available in the Backstage view in Excel 2013.
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…

930 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

15 Experts available now in Live!

Get 1:1 Help Now