I have a list of over 100 users that I need to remove from all groups that they are a part of (other than the primary group). So I'm trying to make a script that will take each user from my list, delete all the group memberships they have, then do that to the next user and so on.
I think the main problem I am trying to get around is that you can pipeline multiple users to the command Remove-ADPrincipalGroupMembership, but not groups. On the other hand you can pipeline multiple groups to the command Remove-ADGroupMember but not multiple members. Wondering if there is any way to get around this. Any help would be greatly appreciated. Thanks.