admin管理员组文章数量:1350912
Situation: There are two domains, DomainA and DomainB. DomainA and DomainB trust each other (two way trust). GroupA is in DomainA UserB is in DomainB
I want to add UserB to GroupA by PowerShell command.
I tried below command, but error has occurred. Why this error occur? And please tell me how to fix it.
Command: Get-ADGroupMember -identity “GroupA” -Members “[email protected]” -Server “[email protected]”
Error:
PS> Add-ADGroupMember -Identity GroupB -Members [email protected] -Server “[email protected]”
Add-ADGroupMember : Cannot find an object with identity:
'[email protected]' under: 'DC=SUB,DC=DomainA,DC=com'. At line:1 char:1
+ Add-ADGroupMember -Identity GroupA -Members [email protected] - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (DomainA\User1:ADPrincipal) [Add-ADGroupMember], ADIdentityNotFoundException
+ FullyQualifiedErrorId : SetADGroupMember.ValidateMembersParameter,Microsoft.ActiveDirectory.Management.Commands.AddADGroupMember
I tried to set -Members both “[email protected]” (UserPrincipalName) and “DomainB/UserB” but error occurred. The major version of PowerShell is 4.
本文标签: powershellAddADGroupMember from other domain userStack Overflow
版权声明:本文标题:powershell - Add-ADGroupMember from other domain user - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743883987a2555718.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论