$GetGroupsFromUser = Get-ADPrincipalGroupMembership $WPFnamelookupbox.Text | Where-Object { $_.Name -like \'G1*\' } $Groups = Get-ADGroup -Filter {N
You could use Compare-Object:
Compare-Object
$GetGroupsFromUser = Get-ADPrincipalGroupMembership $WPFnamelookupbox.Text | Where-Object {$_.name -like 'G1*' } $Groups = Get-ADGroup -Filter "name -like 'G1*'" Compare-Object $Groups $GetGroupsFromUser | Where-Object {$_.SideIndicator -eq "<="}