How to List Members in an AD Group

We need to list all the members in an AD group from time to time for review purposes. The commands are dsget and dsquery. A problem I had was that I could not remember the proper syntax for this, and every time I needed to use them, I had to look them up again. Here are the commands.

dsquery group -name "GROUP-NAME" | dsget group -members -expand

Replace the GROUP-NAME with your group name. For the first part, query the AD using the GROUP-NAME provided. Its output will be sent to dsget to list the members in the group.

Again, if you are interested in details of the commands, try the following.

dsquery /?

dsget /?

For other Windows command line tips, check out this highly recommended book: Windows Command-Line Administrator’s Pocket Consultant, 2nd Edition


This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.


Be the first to comment

Leave a Reply