Hello
we have a lot of AD groups which have members from 2 different domains within our forest.
To get the member of a group I usually would use the command
Get-ADGroupMember
But if a group contains members from different domains you can not use this command, because you get a exeption error.
That’s why I deceided to use the command
Get-ADGroup <groupname> -Properties Members | select members
But using the command the output is not only the members of the group, but together with the OU, like
Actually it is the Distinguished Name you get. If you want to get the Common Name (CN) you may query the according AD for this attribute or you use string acrobatics.
Given your example output it could look like this: