Solved

Remove an AD group from multiple other AD Groups

Posted on 2016-11-02
4
31 Views
Last Modified: 2016-11-02
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
Comment
Question by:MilesLogan
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41871186
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
 
LVL 6

Expert Comment

by:gilnov
ID: 41871222
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
 
LVL 6

Expert Comment

by:gilnov
ID: 41871226
Unless this is a homework assignment and we just helped you cheat!
0
 
LVL 2

Author Closing Comment

by:MilesLogan
ID: 41871539
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

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now