0

I have about 1,000 users that I need to remove from a group. The problem is the group is nested into a group which is then nested into another group.

Group A Group B ---->Group 1 ---->Group P1

Group A, B are all nested in group 1. Group 1 is then nested in Group P1. The end goal is to remove all users that have been disabled for 90+ days from Group P1. The obvious answer is to write a script that will remove the disabled users from Group A,B,C etc but there are hundreds of small groups here. Does anyone have an idea of an effecient way of doing this?

  • I don't understand. Are the users members of **all** of the groups or only **one** of the groups? – joeqwerty Sep 25 '20 at 23:06
  • You can look at `Get-AdGroupMember -Identity 'Group P1' -Recursive`. Maybe that helps to retrieve all the users from your top group. – Alex_P Sep 28 '20 at 11:58
  • @joeqwerty reads like each of the nested subgroups has the potential to have disabled users. – Jeter-work Sep 29 '20 at 18:03

0 Answers0