Azure ad – Powershell – remove user from group a if they are a member of group b

Welcome Forums General PowerShell Q&A Azure ad – Powershell – remove user from group a if they are a member of group b

Viewing 2 reply threads
  • Author
    Posts
    • #277506
      Participant
      Topics: 1
      Replies: 2
      Points: 16
      Rank: Member

      Hello IT Professionals,

      I need some help, I am trying to create some powershell script that will check if a user is a member group B and then if they are remove them from group A – Im still very new to powershell and scripting so i am having a little trouble and wondering if I could get some assistance !

      Here is what i have so far and i all I can do is list the members of group B

      Im not sure how i take the members object ids and then do an if found against the other group id and then remove that object id

      I have tried to adapt an on premise script and im just having troubles as im new to this

      [/crayon]
    • #277509
      Participant
      Topics: 1
      Replies: 2
      Points: 16
      Rank: Member

      This was the on premise scritp i was trying to adapt.

      Appreciate any help with this.

      [/crayon]
    • #277614
      Participant
      Topics: 1
      Replies: 2
      Points: 16
      Rank: Member

      This was Answered for me on another forum https://www.reddit.com/r/AZURE/comments/k910l4/azure_ad_powershell_help_user_group_memberships/

      Kudos to TheStig1293 on reddit

      [/crayon]
Viewing 2 reply threads
  • You must be logged in to reply to this topic.