Members from Nested Group
To display the list of members, recursively expanded
In the below command, you can extract the group membership details, if you have a group that member of this group then this command will extract all the members including the nested groups(group with in the group)
So you will get all the members list form the group, members and members of members (nested groups)
syntex:
dsget group “Group DN” –members –expand
dsget user “User DN” –members –expand
Example:
dsget group “CN=sales,OU=test,DC=test,DC=com” –members –expand >c:tempmembers.txt
dsget user “CN=smith,OU=test,DC=test,DC=com” –members –expand >c:tempmembers.txt
If you don’t want the nested groups, only the members on the group or user then use the below command
syntex:
dsget group “Group DN” –members
dsget user “User DN” –members
Example:
dsget group “CN=sales,OU=test,DC=test,DC=com” –members >c:tempmembers.txt
dsget user “CN=smith,OU=test,DC=test,DC=com” –members >c:tempmembers.txt
There is a mistake in your article. The dsget syntax for user does not have -members parameter. A -memberof switch is used instead. So the correct command is:
dsget user “User DN” -memberof -expand