Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


October 2008

Listing Members of an AD Group


RSS
Subscribe to Windows IT Pro | See More Active Directory (AD) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
Main Article    Ask the Experts

Q: How can I list all the members of an Active Directory (AD) group?

A: The Windows Server 2003 Dsget command is useful for getting information about AD objects, including groups. When you use Dsget with the -members switch, it will output the distinguished names (DNs) of all members of a group, as the following command and output shows:

dsget group "cn=Members,
ou=Justice League,dc=
savilltech,dc=com" -members "CN=Barry Allen,OU=Justice League,DC=savilltech,DC=com" "CN=Kara Zor-El,OU=Justice League,DC=savilltech,DC=com" "CN=Helena Bertinelli,OU=Justice
League,DC=savilltech,DC=com" "CN=Ted Kord,OU=Justice League,DC=savilltech,DC=com" "CN=Jason Todd,OU=Justice League,DC=savilltech,DC=com" "CN=Dick Grayson,OU=Justice League,DC=savilltech,DC=com"
If you want to display information other than the DN, you can use the the pipe (|) character, which lets you pass the output of one command as input to another command. In this case, you can pipe the output of Dsget to another Dsget query to gather the desired information. For example, if you want the SAM ID, User Principal Name (UPN), and description, you would use the command
dsget group "cn=Members,
ou=Justice League,dc=savill
tech,dc=com" -members | dsget
user -samid -upn -desc

Notice that the code after the pipe character in the command is the second Dsget command, which gathers the account detail displayed in Table 1.

—John Savill

End of Article



Reader Comments
It is very good tool. This short introducing allow to understand how it use and build more complicated queries.

RobMik October 12, 2008 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Have New Features Made Exchange Server Backups Unnecessary?

Cluster continuous replication and Volume Shadow Copy Service might have made backups unnecessary in Exchange 2007, but will admins feel comfortable without a dedicated backup solution in place? ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...


Active Directory (AD) Whitepapers Sustainable Compliance: How to reconnect compliance, security and business goals

Managing Unix/Linux with Microsoft System Center Operations Manager 2007 Cross Platform Extensions Beta

Addressing the Insider Threat with NetIQ Security and Administration Solutions

Related Events Check out our list of Free Email Newsletters!

Active Directory (AD) eBooks Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Keeping Your Business Safe from Attack: Encryption and Certificate Services

Windows 2003: Active Directory Administration Essentials

Related Active Directory (AD) Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing