> For the complete documentation index, see [llms.txt](https://tenaka.gitbook.io/pentesting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tenaka.gitbook.io/pentesting/enumeration/windows/groups/groups-ps.md).

# Groups PS

#### #Enumeration Groups

get-adgroup -Filter \*

#### #Get members of a group&#x20;

Get-ADGroupMember -Identity "domain admins" -Recursive

#### #Get group and the member of the group&#x20;

$gg = get-adgroup -Filter 'name -like "*sccm*"' -Properties \*| Select-Object SamAccountName foreach ($g in $gg) { Write-Host $g -ForegroundColor Green Get-ADGroupMember -Identity $g.SamAccountName | Select-Object samaccountName }

#### #Get group membership of account&#x20;

Get-ADPrincipalGroupMembership -Identity samaccountname
