How would you copy the members (including users and groups) of GROUP-A to another group (GROUP-B)? I figured that out today.
Open Active Directory Module for Windows PowerShell in Administrative Tools and type the following command.
Get-ADGroupMember -Identity GROUP-A | Add-ADPrincipalGroupMembership -MemberOf GROUP-B
Get-ADGroupMember gets all the members of GROUP-A and pipes into Add-ADPrincipalGroupMembership cmdlet that added the incoming members to GROUP-B.
Thanks for posting this. Saved me a ton of time creating new groups with some minor adjustments. However, ran this through PowerShell 3 (as administrator) and it work just fine – did not have to use the AD Module for Windows Powershell.
Thanks a lot!!! 🙂
Thanks for the tip. It saved me a lot of time.
Thanks for posting this. Saved me a ton of time creating new groups with some minor adjustments
Thank you.
This works great, but only if the users in the results of the ‘Get-ADGroupMember’ are not members of a child domain. Is there a way to allow this to work for the entire directory?
Excellent – worked like a treat! Tho ‘ as I had to run PowerShell as Administrator before it worked!
Is there a Power Shell way to add a list of user ID’s to a GROUP on the Windows Active Directory “UNIX Attributes” tab?
I already entered the users on the GROUP MEMBERS tab, but now, I’m learning that I also have to list them again on the “UNIX Attributes” tab for our application to work. Any suggestions?
Thanks for this, do you have a script that will add AD users within a parent group as well as the users of sub groups within that Parent group recursively to another AD group?