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? Thanks alot :)
|
feedback
|
|
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":
| |||||||
feedback
|
|
"all the members of an AD" - Should that be "AD group"? If so, using the Active Directory Module for Windows PowerShell, you could issue the following command:
If you'd like to get all members of all groups (per your comment), do the following:
If you need to recurse through nested groups, add the -recursive switch to the GetADGroupMember cmdlet. | |||||
feedback
|