简体   繁体   中英

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.

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

Make sure the group names have their respective domains prefixed ie 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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM