• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

active directory query

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
steveLaMi
Asked:
steveLaMi
1 Solution
 
mass2612Commented:
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
 
Jay_Jay70Commented:
dsget group "cn=Groupname,ou=OUname,DC=Domain,DC=Local" -members
0
 
inbarasanCommented:
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
 
ryangormanCommented:
Lots of great answers. As a 0 point refinement to Jays submission.

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

0
 
Jay_Jay70Commented:
Show off!! **Grin** :-)
0

Featured Post

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now