Filter multiple users from Get-AdUser

Good morning!

I have 3 groups (Group1, Group2, Group3) with members in each saved to the variable $ExcludeList. I would like to query our base Accounts OU and add users to another group (Group4) that are not in any of the first 3 groups however I cannot figure out how to -Filter $ExcludeList

Any help would be greatly appreciated!


Could you please share the code you have so far as we do not like to provide ready to use code on request here? :wink: Please format it as code using the code tags “PRE”. Thanks
You might read the instructions how to use this forum: Read Me Before Posting! You’ll be Glad You Did!

I actually figured the quickest way to do it was to just add everyone from the OU into Group4 then remove the users from the other 3 groups.


Great. Thanks for sharing your trick. :wink: