Chun Lai
Chun Lai

Reputation: 35

Adding AD group to another AD group

I'm trying to add an AD group to another AD group but in a different forest. There's a trust between these 2 domains.

$DomainA = "<domain>"
$DomainB = "<different domain>"
Add-ADGroupMember -Identity "<ad group name>" -Server $DomainA -Members "<ad group name>" -Server $DomainB

What is the best way to cross add the groups?

Error I receive: Add-ADGroupMember : Cannot bind parameter because parameter 'Server' is specified more than once. To provide multiple values to parameters that can accept multi ple values, use the array syntax.

Upvotes: 0

Views: 334

Answers (1)

RichardM
RichardM

Reputation: 189

Use the param server only once, either DomainA or DomainB.

Make sure the group names have their respective domains prefixed i.e. DomainA\GroupName.

As an example, GroupB in DomainB would become a member of GroupA in DomainA :

Add-ADGroupMember -Identity "DomainA\GroupA" -Members "DomainB\GroupB" -Server "DomainA"

Upvotes: 1

Related Questions