• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 54
  • Last Modified:

Remove an AD group from multiple other AD Groups

Hi EE

Does anyone have a script to share that will remove an AD group from being a MemberOf other AD groups ?
I want to add to a text file the groups that the group should be removed from .

thanks !!
0
MilesLogan
Asked:
MilesLogan
  • 2
1 Solution
 
SubsunCommented:
To remove GroupA from all groups listed in text file..
GC C:\temp\Groups.txt | % {Remove-ADgroupmember -Identity $_ -Member "GroupA"}

Open in new window

Following code will remove all groups listed in the text file from GroupA
$Groups = GC C:\temp\Groups.txt
Remove-ADgroupmember -Identity "GroupA" -Member $Groups

Open in new window

0
 
gilnovSystems AdministratorCommented:
I'm confused. Why can't you just go to the "Member Of" tab on the subject group and remove the memberships you don't want there?
0
 
gilnovSystems AdministratorCommented:
Unless this is a homework assignment and we just helped you cheat!
0
 
MilesLoganAuthor Commented:
Thank You Subsun ..

oh an its not cheating ... EE is like having co workers that can help in a bind ..

appreciate your help Subsun .
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now