Copy Active Directory group membership from user to user

This is something that has been done before, quite a lot actually.
What I wanted to do was write a script to copy the group membership of user 1 to user 2.
But… I also wanted the option to remove the group membership from the source user.
I also want the helpdesk to be able to do this, so some feedback from the script is required.

Think about the usecase for such a script/function, for example in migrations.
You could put in a little line to also disable the source account 🙂

Anyhow, here you go… a function that does what I described:

Leave a Reply

Your email address will not be published. Required fields are marked *