Powershell Get-Aduser -Ldapfilter command for searching all users outside a group

Asked

Viewed 191 times

0

What is the command to search all domain users that do not belong to a certain GG?

I’ve tried using:
Get-ADUser -ldapfilter {(&(name*)(!memberof=*GG_DI-ADM))} -properties * | select name, samaccountname, enabled

The thing is, in GG they have 30 people and when I search without the negative condition nobody appears. When I put equal to the code above appear all users without restricting the group.

  • What is this GG?

  • a network folder that only computer users have

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.