Solved

active directory query

Posted on 2006-10-30
5
226 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 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