Solved

Via Ldap how can i retrieve all group members?

Posted on 2011-09-15
11
514 Views
Last Modified: 2012-05-12
Hi,

Via Ldap how can i retrieve all group members?
So can use as a query in AD.
Thanks
0
Comment
Question by:bsharath
  • 4
  • 4
  • 3
11 Comments
 
LVL 57

Accepted Solution

by:
Mike Kline earned 250 total points
ID: 36541725
You can use this in ADUC


 (&(objectcategory=person)(objectClass=user)(memberOf=DN of your group))

Thanks


Mike
0
 
LVL 11

Author Comment

by:bsharath
ID: 36541738
Thanks
But does not work

(&(&(objectcategory=person)(objectClass=user)(memberOf=IUK)))

IUK is the group name
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36547100
When people refer to a DN, or distringuishedName, in Active Directory, it is the fully qualified name structure, as in
memberOf=CN=IUK,OU=SecondOU,OU=FirstOU,DC=domain,DC=com

Rob.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 11

Author Comment

by:bsharath
ID: 36547331
Thanks Rob it does work
Can we just give the group name rather than whole
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 36547357
not via an ldap query using memberof, you need then entire DN

thanks

Mike
0
 
LVL 11

Author Comment

by:bsharath
ID: 36547382
Any other ways?
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36547392
The only other way is via a script, or the command line tools, I think something like
dsquery group domainroot -name iuk* | dsget group -members

Rob.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36547401
If you get
dsget failed:`Target object for this command' is missing.

that means that the dsquery did not find a group name matching your string value.

Rob.
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 36547494
are you just trying to run queries against AD?   Can you use third party (free) tools also?
0
 
LVL 11

Author Comment

by:bsharath
ID: 36547507
I want it via the AD queries
0
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 250 total points
ID: 36547525
You can't do wildcards in ADUC with MemberOf. You have to use the dsquery and dsget tools for the simplest method, or write a script to prompt from the group name.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Powershell out file or export to csv 2 46
Duplicate SPN records 4 19
PowerShell .lastLogonTimestamp off 11 27
Domain Controller FSMO 7 38
Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

772 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