Tuesday, September 6, 2011

Get the user list for an Active Directory group

dsquery group -samid SecurityGroup | dsget group -members -expand | findstr /i ",OU=UserAccounts," | dsget user -samid > c:\SecurityGroup_userlist.txt

2 comments:

Carlos Klapp said...

Good query reference:
http://social.technet.microsoft.com/wiki/contents/articles/2195.active-directory-dsquery-commands.aspx

Carlos Klapp said...

Good query reference:
http://social.technet.microsoft.com/wiki/contents/articles/2195.active-directory-dsquery-commands.aspx