Sunday, August 21, 2011

Set SharePoint to use cross-domain queries (PeoplePicker)

Scenario:
You have 3 domains env's, DEV - TEST - PROD.
prod.contoso.com | NetBIOS: PROD
test.contoso.com | NetBIOS: TEST
dev.contoso.com | NetBIOS: DEV

One-Way Trusts:
DEV > PROD
TEST > PROD

You have SharePoint Farm in your Dev env, you want to access to this farm from your Prod env without entering your Dev user.

Resolution:
Using the right command with STSADM you can set PeoplePicker at your farm to find also users from your prod.contoso.com and dev.contoso.com.

Phase 1:
Open CMD as administrator and type:

Syntax: stsadm.exe -o setapppassword -password <RandomString>

Simple: stsadm.exe -o setapppassword -password GsfE2#4ew


Phase 2:
Enter this command with the following settings:

Syntax: stsadm.exe -o setproperty -pn peoplepicker-searchadforests -pv "<Valid list of forests or domains, Login name, Password>" -url <Web application URL>

Simple: stsadm.exe -o setproperty -pn peoplepicker-searchadforests -pv "prod.contoso.com,PROD\OrB,EGsf#fr3" -url Http://spsdev2010

* The user you enter needs rights to your AD !


* From my experience with this command you can type this syntax and you will get "Command line error" .. as I know you can write this command as follows:

- Simple 2: stsadm.exe -o setproperty -pn peoplepicker-searchadforests -pv "domain:prod.contoso.com" ,PROD\OrB,EGsf#fr3 -url Http://spsdev2010
Simple 3: stsadm.exe -o setproperty -pn peoplepicker-searchadforests -pv "forest:prod.contoso.com" ,PROD\OrB,EGsf#fr3 -url Http://spsdev2010

Phase 3:
Check your self:

Syntax: stsadm.exe -o getproperty -url <Web application URL> -pn “peoplepicker-searchadforests

Simple: stsadm.exe -o getproperty -url Http://spsdev2010 -pn “peoplepicker-searchadforests”

You need to see your domain from the last command that you ran on Phase 2.

Why inventing the wheel again ?!
Refer to this great sites:
Configure People Picker (SharePoint Server 2010) - TechNet
People Picker overview (SharePoint Server 2010) - TechNet

* Known Issues:
SharePoint 2010: people picker issue "There was an error in the callback"
More People Picker issues - Great post about issues with this command !