Extracting users from a Group

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to list the users in a AD Security group. This is the result I get:

C:\Documents and Settings\Administrator>dsquery group "cn=TSP All
Users,ou=Domain Groups,dc=win,dc=ece,dc=mcgill,dc=ca"
"CN=TSP All Users,OU=Domain Groups,DC=win,DC=ece,DC=mcgill,DC=ca"

I seem to be able to list the group and not the users whithin the group.

How do I go about listing the users IN the group?

TIA, Ben
 
Two options:

1. If you know the DN of a group, you can directly use dsget group
groupDN -members
2. If you are doing dsquery, then you can pipeline your dsquery output to
dsget like
C:\Documents and Settings\Administrator>dsquery group "cn=TSP All
Users,ou=Domain Groups,dc=win,dc=ece,dc=mcgill,dc=ca" | dsget group -members

--
Regards

Matjaz Ladava, ladava.com
MCSA, MCSE, MCT
Microsoft MVP Windows Server - Directory Services
e-mail: (e-mail address removed), (e-mail address removed)
 
Hi,

I'm trying to list the users in a AD Security group. This is the result I get:

C:\Documents and Settings\Administrator>dsquery group "cn=TSP All
Users,ou=Domain Groups,dc=win,dc=ece,dc=mcgill,dc=ca"
"CN=TSP All Users,OU=Domain Groups,DC=win,DC=ece,DC=mcgill,DC=ca"

I seem to be able to list the group and not the users whithin the group.

How do I go about listing the users IN the group?

TIA, Ben
dsget group "CN=TSP All Users,OU=Domain Groups,DC=win,DC=ece,DC=mcgill,DC=ca" -members
or
dsget group "CN=TSP All Users,OU=Domain Groups,DC=win,DC=ece,DC=mcgill,DC=ca" -members -expand



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Hi guys,

Thanks a lot for all your input. I tried all 3 sugesstions and they all work
great! I'm sure I'll use them in the future quite a bit.

Cheers, Ben
 
Back
Top