Copy AD Group Members

 

This is something that should be built into AD. If you have a large security group in AD and you need to duplicate the members, you have to add each user one at a time into the new group. This isn’t just pain it takes ages and there is always to possibility that you miss a user or add the wrong user.

I have written a Powershell script that that will copy the members of one group to another. Create the new group in AD and then edit this script. This will copy all the members from one group to the other, saving you time.

Import-Module ActiveDirectory

$fromgroup = Get-ADGroup “From Group
$togroup = Get-ADGroup “To Group

foreach ($member in Get-ADGroupMember $fromgroup)
{
    Add-ADGroupMember -Identity $togroup -Members $member
}

Advertisements

About Fuckthiscrapsite
It wont let me reuse passwords or delete my account so Fuckthiscrapsite change to random crap until they delete it

One Response to Copy AD Group Members

  1. beton says:

    Hello very nice site!! Man .. Beautiful .. Amazing .. I will bookmark your website and take the feeds alsoˇKI’m satisfied to search out so many helpful information here within the submit, we’d like work out more techniques on this regard, thank you for sharing. . . . . .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: