XenApplePie

Cross Domain User Add Between Domains With Two-Way Transitive Trust

Quick little script to add users from one domain to a group in another domain.

# Quick cross domain user add with 2 domains in the same forest with two-way transitive trusts using universal / domain local groups for access.
$userDomain  = "userdomain"
$groupDomain = "groupdomain"
$userName    = "useraccountname"
$groupName   = "groupname"
$User        = Get-ADUser -Identity $userName -Server $userDomain
$Group       = Get-ADGroup -Identity $groupName -Server $groupDomain

Add-ADGroupMember -Identity $Group -Members $User -Server $groupDomain
Exit mobile version