I have a farm installed on a machine in domain X. Domain X is "trusted" relation with another domain Y.

If I want to programmatically get an user, I can do something like:


But this only work with user of Domain X and not with user of Domain Y! I know there is a way to add to people picker other domains, so I try it... From people picker I can find user from the other account but if I call the EnsureUser on a user that I never added from People Picker (so not registered to SP), it tolds me he can't find that user.

How can I do to make sharepoint works on 2 domains? Is there any way (Powersherll script eg) other way to make sharepoint know about all of that user?

I tried also getting all user from a LDAP call and adding on SP by AddUser function.. This seems to work, but when I try to add the user to a Group or impersonate it, Sharepoint throws an Exception 'bout permissions..

Any ideas?

Thank you!

1 Answer 1


Is your trust transitive? Also, which domain is your SharePoint service account located in?

In my experience if you have domain Y which trusts domain X but not the other way around, you need to have the sharepoint service account in domain X.

Does user profile sync work for both domains? Did you setup connections for both domains?

  • In can answer only to the first 2 questions: the trust is transitive and the Sharepoint service is locate in the X domain
    – Ziba Leah
    Apr 19, 2012 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.