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:
web.EnsureUser(DOMAIN\Username);
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!