LDAPFilter Help

Hello Powershell Teams!!!

I am truing to pull user from AD that are member of the groups with Teammate in it.
UserAttribute

I use this basic script but I am not getting any output. Any help will be greatly appreciated.

$ADLocation = 'OU=Users,OU=CH,DC=Contoso,DC=com'
Get-ADUser –SearchBase $ADLocation –LDAPFilter memberOf=*Teammates

Wildcards are not supported in LDAP filters for memberOf.

Try something like this (not tested):

Get-ADGroup -filter "name -like '*TeamMates*'" | Get-ADGroupMember
2 Likes

Works perfect :smile:

Thank you Matt!

1 Like

Good to know that. I was trying to put wildcards everywhere in my queries. :sweat_smile: