I have the query below that returns all the members of certain groups types i.e. Domain Local but I'm looking to limit the results to specific type of members i.e. users rather than computer or global groups etc. Any ideas?
$Groups = Get-ADGroup -Filter {groupscope -eq "DomainLocal"}
ForEach($GroupName In $Groups)
{
"== Group name: {0} ==" -f $GroupName
$MembersList = @()
$MembersList = get-adgroupmember $GroupName | Select Name
$MembersList
"==== Total members: {0} ====" -f $MembersList.Length
}