Solved

active directory query

Posted on 2006-10-30
5
225 Views
Last Modified: 2010-04-18
I am trying to create a query in active directory that will show me the members of a certain group.  Anyone know how to do this?
0
Comment
Question by:steveLaMi
[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
5 Comments
 
LVL 29

Accepted Solution

by:
mass2612 earned 500 total points
ID: 17839606
Hi,

Try this vbscript just save as a vbscript and edit the group name, OU and domain info.

On Error Resume Next
 
Set objGroup = GetObject _
  ("LDAP://cn=GroupName,ou=Sales,dc=mydomain,dc=com")
objGroup.GetInfo
 
arrMemberOf = objGroup.GetEx("member")
 
WScript.Echo "Members:"
For Each strMember in arrMemberOf
    WScript.echo strMember
Next
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 17839619
dsget group "cn=Groupname,ou=OUname,DC=Domain,DC=Local" -members
0
 
LVL 14

Expert Comment

by:inbarasan
ID: 17840014
net group "groupname" will also show you the members of a group and this should be run on a DC

Hope this simple command helps you
0
 
LVL 10

Expert Comment

by:ryangorman
ID: 17840454
Lots of great answers. As a 0 point refinement to Jays submission.

dsquery group -name "groupname" | dsget group -members

0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 17840695
Show off!! **Grin** :-)
0

Featured Post

Industry Leaders: 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

Suggested Solutions

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 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