How To Get A List Of Members Of An AD Group Using DSQuery & DSGet

If you need to get a list of members of agroup in AD, you can run a command to pipe this list into a text file. Here’s how to get a list of members of a group in AD using the command line:

dsquery group -name “name of group” | dsget group -members > C:\Temp\List.txt

The list will be in a format that is used by the DSQuery set of tools. If you need the list as a list of users only (and no information about where the users are in AD), then open the list in Notepad and use Find and Replace (Ctrl+H) to find the data that you don’t need and replace it with nothing.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

Leave a comment

Your email address will not be published. Required fields are marked *