List AD group members in PowerShell

Here’s how to list AD group members in PowerShell:
PS C:\Users\Vorkbaard> Get-ADGroupMember "ALLOW USB DATA" -Recursive | select name | Sort-Object name

Get-ADGroupMember gets all group members. My group is called ‘ALLOW USB DATA’ (it is connected to a group policy that allows or denies users data access to usb devices based on this group membership).
-Recursive lists nested group members instead of nested group names.
select name prints just the name, no other information like SID and objectClass.
Sort-Object name sorts by ‘name’

Back to Top