The problem is the attempted creation of a user object (not an AD object, just within the PowerShell session) from a different domain.
The easiest way around this is to use ADSI instead of Set-ADUser.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Everyone and Support,
Really need your help to solve this solution. Two domains already fully trusted and Authentication in all forest, permission already verify.
I have two domains. As example Domain A and Domain B, some users in Domain B need to report to specific user in Domain A, below script I used but getting error:
$manager = Get-ADUser -Identity 'CN=UserManager,OU=Users,DC=domainA,DC=com' -Server 'domainA.com:3268' # Uses Global Catalog (GC)
Then Enter:
Set-ADUser -Identity 'UserReporting' -Manager $manager -Server 'domainB.com'
Then Enter -> Error code shows as below:
Set-ADUser : The name reference is invalid
At line:1 char:1
+ Set-ADUser -Identity 'UserReporting' -Manager $manager -Server 'domainB ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (UserReporting:ADUser) [Set-ADUser], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:8373,Microsoft.ActiveDirectory.Management.Commands.SetADUser
The problem is the attempted creation of a user object (not an AD object, just within the PowerShell session) from a different domain.
The easiest way around this is to use ADSI instead of Set-ADUser.
$User = Get-ADUser -Identity <ADUser_domain1> -server <domain1>
$Manager = Get-ADUser -Identity <ADUser_domain2> -server <domain2>
$User | Set-ADUser -Manager $Manager