This is a quick post that enables you to add group members from a pre-existing group to a newly created group, this is a "one liner" for least administrative effort.
Get-ADGroupMember -Identity "<preexisting_group>" | ForEach-Object {Add-ADGroupMember -Identity "<new_group>" -Members $_.distinguishedName}
In this it real world would look something like this:
Get-ADGroupMember -Identity "BearBasic" | ForEach-Object {Add-ADGroupMember -Identity "BearGuests" -Members $_.distinguishedName}
The command above would add all the people from "BearBasic" to "BearGuests" however this can be used a group of any size, however when this command has completed, remember it may take a few seconds for replication, this also is a good place to list other "operational" commands:
Export AD group members to CSV
Get-ADGroupMember -Identity "GroupName" | Select-Object name,samAccountName,distinguishedName | Export-CSV -Path "C:\GroupMembers.csv" -NoTypeInformation
Compare members between two groups:
Compare-Object -ReferenceObject (Get-ADGroupMember -Identity "Group1" | Select-Object -ExpandProperty distinguishedName) -DifferenceObject (Get-ADGroupMember -Identity "Group2" | Select-Object -ExpandProperty distinguishedName)
Add members who are in one group but not in another
Get-ADGroupMember -Identity "SourceGroup" | Where-Object {-not (Get-ADGroupMember -Identity "TargetGroup" | Select-Object -ExpandProperty distinguishedName).Contains($_.distinguishedName)} | ForEach-Object {Add-ADGroupMember -Identity "TargetGroup" -Members $_.distinguishedName}
Remove all members from a group
Get-ADGroupMember -Identity "GroupName" | ForEach-Object {Remove-ADGroupMember -Identity "GroupName" -Members $_.distinguishedName -Confirm:$false}
Copy group memberships from one user to another
Get-ADUser -Identity "SourceUser" -Properties MemberOf | Select-Object -ExpandProperty MemberOf | ForEach-Object {Add-ADGroupMember -Identity $_ -Members "TargetUser"}
Find users who are members of both groups
(Get-ADGroupMember -Identity "Group1").distinguishedName | Where-Object {(Get-ADGroupMember -Identity "Group2").distinguishedName -contains $_} | ForEach-Object {Get-ADUser -Identity $_}
Add users matching specific criteria to a group
Get-ADUser -Filter "Department -eq 'IT' -and Enabled -eq 'True'" | ForEach-Object {Add-ADGroupMember