Add members from another AD to a group

by tim91700 at 2013-01-16 00:06:24


I have two domains :

-d1 : i’m here
-d2 : it’s the domain of my company

I want to create a copy of groups with names from a txt file, like :
These groups already exist on d2.

I want to copy all members of d2.toto in d1.toto.
It like that with the active directory interface :

-Select the new group d1.toto
-Add member and search on d2 with toto as name
-Click to confirm with credential

Is it possible ?
by RichardSiddaway at 2013-01-16 05:15:40
Are these two totally separate domains or are they in the same forest?

Yes this is possible. I can’t test this at the moment but you could create the groups
$groups = get-content groupnamefile.txt
foreach ($group in $groups){
new-adgroup -Name $group -samAccountName $group -GroupScope Global -GroupCategory Security

It sounds like you just want a copy of the company domain for test purposes. Why not do a backup and restore?