Copy User Membership KB ID 0001828
If you have a lot of user groups and simply want to copy/clone one users group membership to another user, then with PowerShell that’s quite simple to do.
Solution: Copy User Membership
Here I have two users ALane who is a member of a few groups and APatel who is simply a member of domain admins.
Although we can see above what groups ALane is a member off let’s prove that will PowerShell.
Get-ADUser -Identity ALane -Properties memberof | Select-Object -ExpandProperty memberof
Copy User Membership
Then let’s copy the groups from ALane to APatel.
Get-ADUser -Identity ALane -Properties memberof | Select-Object -ExpandProperty memberof | Add-ADGroupMember -Members APatel
And finally, lats make sure APatel is a member of those groups.
Get-ADUser -Identity APatel -Properties memberof | Select-Object -ExpandProperty memberof
Or simply look in Active Directory users and computers (you might need to refresh if you already had APatel’s properties open!)
Related Articles, References, Credits, or External Links