简体   繁体   English

将 AD 组添加到另一个 AD 组

[英]Adding AD group to another AD group

I'm trying to add an AD group to another AD group but in a different forest.我正在尝试将一个 AD 组添加到另一个 AD 组,但在不同的林中。 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.我收到错误:Add-ADGroupMember:无法绑定参数,因为多次指定了参数“服务器”。 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.仅使用一次参数服务器,DomainA 或 DomainB。

Make sure the group names have their respective domains prefixed ie DomainA\GroupName.确保组名具有各自的域前缀,即 DomainA\GroupName。

As an example, GroupB in DomainB would become a member of GroupA in DomainA:例如,DomainB 中的 GroupB 将成为 DomainA 中 GroupA 的成员:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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