Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

excluding existing members

$
0
0

I use this script to copy members from one group to another. I need to update it to ignore members that are already a member of the destination group. Otherwise it says that the specified user is already a user that is already a member.

$oldgroup = "Oldtest"
get-adgroup NewTest | Add-ADGroupMember -members (Get-ADGroupMember $oldgroup)


Viewing all articles
Browse latest Browse all 6937

Trending Articles