Solved

active directory query

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

16 Experts available now in Live!

Get 1:1 Help Now