PowerShell Script : Copy AD Group Membership

The below PowerShell script will copy Active Directory Group membership from source group to destination group. You need to update the Source and Target group name in the script.

Import-Module ActiveDirectory
$gsource =Get-ADGroup "Test Group1"
$gtarget = Get-ADGroup "Test Group2"
Get-ADGroupMember -Identity $gsource |
foreach {Add-ADGroupMember -Identity $gtarget -Members $($_.DistinguishedName)}

Related Posts

Subscribe to Techuisitive Newsletter

Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.

Scroll to Top