Move or Copy AD users

This is a simple PowerShell script to either copy AD users or move AD users from one AD group to another:

Move AD Users

$sourceADGroupName = "example 1"
$targetADGroupName = "example 2"

Get-ADGroupMember $sourceADGroupName | ForEach-Object {
  Add-ADGroupMember -Identity $targetADGroupName -Members $_ -Confirm:$false
  Remove-ADGroupMember -Identity $sourceADGroupName -Members $_ -Confirm:$false
}

Copy AD Users

$sourceADGroupName = "example 1"
$targetADGroupName = "example 2"

Get-ADGroupMember $sourceADGroupName | ForEach-Object {
  Add-ADGroupMember -Identity $targetADGroupName -Members $_ -Confirm:$false
}