PowerShell Script: Copy AD Group Membership

This PowerShell script copies all members from a source Active Directory group to a target Active Directory group. Before running the script, update the source and target group names to match your Active Directory environment.

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

Explore More Intune Guides

Continue building your Microsoft Intune skills with step-by-step tutorials covering device management, application deployment, automation, and troubleshooting.

  • Microsoft Intune Learning – Explore comprehensive guides on device enrollment, compliance policies, application deployment, Windows updates, and more.
  • Intune Automation – Discover PowerShell and Microsoft Graph automation solutions to simplify repetitive Intune administration tasks.

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