Add members from another domain into a domain local gruop

  • 1.1K Views
  • Last Post 23 September 2015
RedPlumpTomato posted this 23 September 2015

Hi there,
We have two domains.
Domain1
Domain2
Both have a group with the same name: ACCOUNTING.
I would like to add domain1\Accounting as a member of Domain2\Accounting
I can do this in GUI (AD) no problem. But, I can't seem to get it working with powershell. The -members option doesn't seem to work in another domain (even when specifying -server).
I ran this on Domain2
Add-ADGroupMember ACCOUNTING -members
"CN=ACCOUNTING,OU=Groups,DC=domain1,DC=com" -credential domain1\user1
I get an error stating that the group cannot be found. Does anybody have a solution to add users global groups from Domain1 domain into a local group of Domain2

Order By: Standard | Newest | Votes
Marwan-Mohamed posted this 23 September 2015

Hi,


Probably you need to specify the group you need to add in domain1 as a variable in powershell


Then use the variable to be added as a member for the group in domain2



Check this link it could help you


http://blogs.msdn.com/b/adpowershell/archive/2010/01/20/adding-removing-members-from-another-forest-or-domain-to-groups-in-active-directory.aspx



Best Regards


Marwan Ashraf


MCSE 2003 / MCITP / MCSE 2012 / MCT


Sent from my Windows Phone











show

RedPlumpTomato posted this 23 September 2015

Hi Marwan,










Thanks for pointing me in the right direction. The actual command that ended up working was this:

On Domain2 DC, in Powerhsell for AD:

$cred=get-credential

show

Marwan-Mohamed posted this 23 September 2015

Glad to hear that 😊


And thanks for sharing the correct answer.



Best Regards


Marwan Ashraf


MCSE 2003 / MCITP / MCSE 2012 / MCT


Sent from my Windows Phone








show

Close