I've been trying to create a csv file of all the members of an AD but since some groups have members from another trusted domain, these users are not showing up. I also tried outputting users in a text file by using:
dsquery group -name "Group Account Name" | dsget group -members -expand > C:users.txt
and failing. Does someone know if what I'm trying to do is possible?
Best Answer
Your Dsquery syntax is missing the domain root LDAP path. It should look like:
Try with the updated syntax.
As per sysadmin1138's suggestion, here would be the command sent to a variable array "$members":