Filter multiple users from Get-AdUser

Welcome Forums General PowerShell Q&A Filter multiple users from Get-AdUser

Viewing 3 reply threads
  • Author
    Posts
    • #211308
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      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!

       

    • #211317
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      Could you please share the code you have so far as we do not like to provide ready to use code on request here? 😉 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!

    • #211377
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      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.

      Thanks!

    • #211395
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      Great. Thanks for sharing your trick. 😉

Viewing 3 reply threads
  • You must be logged in to reply to this topic.