Powershell Convert AD Groups
Revision as of 15:32, 31 July 2018 by Michael.mast (talk | contribs) (Created page with "==Overview== The title is a little misleading. What I really wanted to do is replicate the existing security groups as domain local, so I can assign users from another domain...")
Overview
The title is a little misleading. What I really wanted to do is replicate the existing security groups as domain local, so I can assign users from another domain to the groups. So in the end I converted
SecurityGroup_1
to
new_SecurityGroup_1
.....THIS NEEDS UPDATING.....
Then, to replicate the memebers to the new group.
Get-ADGroup -Filter {GroupScope -eq 'Global'} -SearchBase "OU=SecurityGroups,DC=yourdomain,DC=tld" | foreach {$name=$_ | select -ExpandProperty name;$newname="new_$name"; $_ | Get-ADGroupMember | foreach {Add-ADGroupMember -Identity "$newname" $_}}