Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Active Directory: Update the manager field when the manager is in a different domain

$
0
0

Hi guys,

I have a script that I'm importing Active Directory attributes from our HR database via a CSV file.  I've got everything working except the Manager piece.  In our environment we have users in two different domains in the forest with the root domain being a shell resource domain. 

Something like:

contoso.com (root shell domain)

west.contoso.com (user domain 1)

east.contoso.com (user domain 2)

The problem I have is when trying to change a user's manager when the manager isn't in the same domain as that user.  So for example user is in west.contoso.com and boss is in east.contoso.com.  Updating via ADUC works just fine.  I've verified I have the manager's DN correctly in the variable.  I've tried different variations of set-aduser.  I tried using domain admin credentials of the user's domain, the manager's domain, and even a user with enterprise admin rights in the shell parent domain.  I've tried setting the "-server" switch to either the user's domain or the manager's domain.  In all cases I get errors either with a permission issue or can't find the object as it's default context is the wrong domain.

How would you add a manager from a different domain in the forest via powershell script then?


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>