Tuesday, October 27, 2009

How to export list of user that are part of a AD Security Group

Every once and a while you come across these little annoying obstacles when working with Active Directory that should be easy to solve but requires some special tools, for example that there is no way to export all the members of a group in the Active Directory Users & Computers GUI tool. Using advanced search filter for a user with the “Member of” filter doesn’t seem to work so one way to do it is with “dsquery” and “dsget”, tools for Windows 2003 that you can find using Google probably. Here is how to list all members of a specific AD group.

List all members in the group "MY_GROUP_NAME" and exports to a file at the following location "C:\Documents and Settings\yourlogin\Desktop\export.txt"

C:\Program Files\Support Tools>dsquery group -name "MY_GROUP_NAME" | DSGET group -members > "C:\Documents and Settings\yourlogin\Desktop\export.txt"

No comments: