Tuesday, April 12, 2011

Active Directory: Copy a Group Members to a new Group

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. 

No comments:

Post a Comment

Followers

hit counter