I currently have ADSI code to get the groups a user is a part of:
$searcher = [adsisearcher]\"(samaccountname=$env:USERNAME)\"
$searcher.FindOne().Properties.mem
You already have both pieces, the first piece is finding the users in the group, the second piece is using the searcher to get properties for the users. Just use distinguishedname
as the [adsisearcher]
filter.
$Group = [ADSI]"LDAP://cn=Test,cn=Test,dc=some,dc=domain,dc=net"
$Group.Member | ForEach-Object {
$Searcher = [adsisearcher]"(distinguishedname=$_)"
$searcher.FindOne().Properties
}