I currently have ADSI code to get the groups a user is a part of:
$searcher = [adsisearcher]"(samaccountname=$env:USERNAME)"
$searcher.FindOne().Properties.memberof
$adgroups = $User -Replace '^cn=([^,]+).+$', '$1'
However, i am wanting to be able to choose a group and see its members. I currently have this code to get their DN and path.
$Group = [ADSI]"LDAP://cn=Test,cn=Test,dc=some,dc=domain,dc=net"
$Members = $Group.Member | ForEach-Object {[ADSI]"LDAP://$_"}
I am wanting to get other attributes if possible (name, etc.). Any help would be appreciated as i have been trying for a bit.