Welcome to MSDN Blogs Sign in | Join | Help

Multi Forest/Cross Forest People Picker peoplepicker-searchadcustomquery

stsadm -help setproperty 

Here's a list of the people picker properties that can be set () 

peoplepicker-activedirectorysearchtimeout
peoplepicker-distributionlistsearchdomains
peoplepicker-nowindowsaccountsfornonwindowsauthenticationmode
peoplepicker-onlysearchwithinsitecollection
peoplepicker-searchadcustomquery
peoplepicker-searchadforests 

 

peoplepicker-searchadforests 

The people picker is flexible.  First, all servers in the farm need to all be within 1 domain.  Users in the forest that the server is in (resource forest) will automatically show up.  Forests that have at least a one way trust to that forest can be "searched" for adding users using the stsadm command in the blog post from Venky. The post also explains the scenario where users have more than one account with the same name or objects which reference their account using the ms-ds-Source-Object-DN an object introduced in Windows 2003 R2.  Venky's post goes into more detail.  In this scenario you would need to maintain the population of that attribute to show where the "real" account is. 

If it is not a two way trust then you will need to specify an account and password, which are encrypted and stored in the config database.  The "peoplepicker-searchadforests" stsadm property allows you to search multiple values when picking users.  With the command you can add multiple forests, domains, and accounts and even specific property searching.

If it is not a two way trust then you will need to specify an account from the user forest.  The "peoplepicker-searchadforests" property allows you to search that forest.  You can add multiple forests, domains, and accounts.  Note: you do need to specify the user password if there's a one way trust, so the picker can look it up.  If this is something that's required in your environment, you'll need to remember to maintain these usernames/passwords.

stsadm.exe -o setproperty -url http://server:port -pn "peoplepicker-searchadforests" -pv "forest:foo.corp.com;domain:bar.foo.corp.com", LoginName, P@ssword

Another example.

peoplepicker-searchadcustomquery

Allows the administrator to set the custom query that is sent to Active Directory.

For example, we could set it to
stsadm.exe -o setproperty -pn peoplepicker-searchadcustomquery -pv "(physicalDeliveryOfficeName={0})"
to search users by office name. Then I could type in 16/3077 to search who is in office 16/3077

Some valid input are
                (SomeAdAttribute={0})
                (SomeAdAttribute={0}*)
                (SomeAdAttribute={0})(AnotherAdAttribute={0})
where SomeAdAttribute or AnotherAdAttribute are the names of some indexed attributes in AD.

If it was set, the custom query and the SharePoint built-in query will be sent together to AD to search people.

*Please use it with caution. If the property value is not a correct AD query, it will causes people picker totally broken. Also, if the searched attribute is not an indexed attribute in AD, it will make AD very slow.*

Note: The People Picker can only do wildcard searches for AD Windows group names.  With any role provider other than the out of the box AD one the role provider lookup is specific to the entire name.  For example if you have a group called "Readers" and you enter "Read" in the People Picker search dialog, it will not find your group; if you enter "Readers" it will.  The role provider doesn’t provide a good way to do wildcard group search.  See "Multiple Auth Providers" for more info.  As well Steven Fowler in figuring out a custom membership provider has some great insights, another post People Picker and Custom Membership provider has dev insights on the GetUser() method.

peoplepicker-onlysearchwithinsitecollection

This will restrict the picker to only people and groups that are in the site collection.

peoplepicker-nowindowsaccountsfornonwindowsauthenticationmode

This could be used to turn off the windows lookup on a non AD web app.  From here you'd be leveraging the customer provider

peoplepicker-activedirectorysearchtimeout

Allows you to manage the active directory search timeout for lower bandwidth/ higher latency environments

peoplepicker-distributionlistsearchdomains

I'm not sure.  I'll try to find out more.  Note: DLs cannot be used for securing a SharePoint site/list,etc... 

<update 4/11/07>

Great Quote from Jim in comments:

To use peoplepicker-searchadforests with credentials, which you need to specify if you don’t have two-way trusts in place, you must first set an encryption key:

stsadm.exe -o setapppassword -password key

This sets a key that will be used to encrypt/decrypt the password in the content database.  Failure to do this results in a “command line error” message.

Secondly, the peoplepicker runs under the credentials of the application pool the site is running in.  Make sure the application pool identity is a domain account with the right permissions.

Joel: This security key is REQUIRED to be run on every server with extended web apps (WFEs AND any index servers that have the WFE role) otherwise it will not work. 

</update>

Related resources:

Determining the Global Deployment Approach

Global & Multi Farm Deployments

Basic and Advanced Deployment in a Nutshell

Security Blog Post on WSS and Office SharePoint Server 2007

SharePoint Manageability and Governance

MultiLingual Solutions on MOSS White Paper (Great info on variations, WSS and MOSS language packs) 

Published Thursday, January 18, 2007 6:44 AM by joelo
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Monday, January 22, 2007 10:49 PM by Ben Curry

# Office SharePoint Server 2007 People Picker From Another Forest

Monday, January 22, 2007 10:52 PM by ben curry

# re: Multi Forest/Cross Forest People Picker peoplepicker-searchadcustomquery

Nice post! I really like the option to turn off windows lookup on non-AD apps. Thanks.

Friday, February 02, 2007 6:26 PM by Chris Ingram

# re: Multi Forest/Cross Forest People Picker peoplepicker-searchadcustomquery

I've been trying to get users from a separate forest into our Sharepoint Portal. There is a one way trust and yet I'm unable to use stsadm.exe as your blog state.

Is this functionality unavailable in SPP 2003?

How do I get users from a separate forest access? I am able to do this with a Captaris tool operating on the same server. But when I run my version of the following command line:

stsadm.exe -o setproperty -url http://server:port -pn "peoplepicker-searchadforests" -pv "forest:foo.corp.com;domain:bar.foo.corp.com", LoginName, P@ssword

which is entered as:

stsadm.exe -o setproperty -url http://sharepointsvr -pn "peoplepicker-searchadforests" -pv "forest:outsideagency.net;domain:domaincontroller.outsideagency.net", trustedaccount, p@ssword

I get a 'Command Line Error'

Is there a way to upgrade the stsadm.exe for this 2003 instance of sharepoint portal server just to bind these accounts??

Saturday, February 03, 2007 8:57 PM by joelo

# re: Multi Forest/Cross Forest People Picker peoplepicker-searchadcustomquery

The people picker stuff I mentioned is for WSS 3.0 and MOSS 2007.

There is a cross forest people picker on gotdotnet a community tool that you could try for SPS 2003.  You can find a link from my 2003 IT Pro resources set of links. "Cross Forest People Picker for WSS (Requires SPS Profiles)"

Monday, February 05, 2007 1:55 AM by Joel Oleson's SharePoint Land

# 25 Tips to Lockdown Your SharePoint Environment

I was preparing for a TechReady (internal Technical Readiness conference) Presentation and for my advanced

Thursday, February 08, 2007 3:03 PM by Drew

# re: Multi Forest/Cross Forest People Picker peoplepicker-searchadcustomquery

I have tried using the peoplepicker-searchadforests setproperty command per your and Bens blogs and no luck. I keep getting "Cannot retrieve the information for application credential key." I am providing username and passwords as well and still nothing.

Any insight would be appreciated!

Sunday, February 18, 2007 2:25 PM by Jim

# re: Multi Forest/Cross Forest People Picker peoplepicker-searchadcustomquery

To use peoplepicker-searchadforests with credentials, which you need to specify if you don’t have two-way trusts in place, you must first set an encryption key:

stsadm.exe -o setapppassword -password key

This sets a key that will be used to encrypt/decrypt the password in the content database.  Failure to do this results in a “command line error” message.

Secondly, the peoplepicker runs under the credentials of the application pool the site is running in.  Make sure the application pool identity is a domain account with the right permissions.

Thursday, March 08, 2007 8:31 PM by Joel Oleson's SharePoint Land

# Cross Forest, Multi Forest Configuration and Additional Info

I’ve been pinged a couple of times recently about multi forest environments. This *does* work. It *was*

Friday, October 12, 2007 7:53 PM by John Roe

# Content Deployment Tips

Content deployment is an excellent way to publish SharePoint content between farms. A few things to keep

Friday, December 05, 2008 5:03 AM by jianyi

# 多域环境下people picker查找不到用户问题的解决

问题:

多域环境下,配置了SSP的UserProfie导入,但是在站点添加用户时仍然找不到新域中用户信息。 解决:

peoplepicker默认只能查找服务器所在的域中的用户信息,若要查...

Wednesday, May 13, 2009 10:05 AM by The Windows Directors' Cuts

# SharePoint People-Picker and Active Directory Part 1

SharePoint People-Picker and Active Directory Part 1

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker