Wednesday 16 February 2011

Exporting Active Directory security group members to text file

One of the bosses asked me for a list of users in a security group just now. Thinking too high of the M$ management console I thought I can just copy and paste all members but I was wrong. So had to learn a new command on the good old command prompt:
dsget group "group distinguished name (DN) i.e. CN=Sales\\ Latin America,OU=Distribution Lists,DC=microsoft,DC=com..." -members >> filename.txt
and ta-da, all members popped up in the text file called filename.txt!

No comments: