Monday, March 15, 2010

SharePoint Peoplepicker‏

Peoplepicker-searchadforests: Stsadm property (Office SharePoint Server)

Permits a user to search from a second one-way trusted forest or domain.

All servers in a farm need to be within one domain. Users in the forest that the server is in (that is, a resource forest) are displayed automatically. Forests that have at least a one-way trust to that forest can be searched for users to add.

When a Web application uses Windows authentication, People Picker searches all two-way trusted forests and all two-way trusted domains. However, if you want to search from a one-way trusted forest or a one-way trusted domain, you must run the setapppassword operation, and then run the peoplepicker-searchadforests property.

The peoplepicker-searchadforests property allows you to search multiple values when users are selected. You also can add multiple forests, domains, accounts, and even specific property searches.

Note:

By default, Microsoft Office SharePoint Server 2007 talks to the domain controller for the domain in which Office SharePoint Server 2007 was installed and all trusted domains for two-way trusted domains.

Examples

Search additional domains or forests

To enumerate a list of users by using People Picker from a second forest or domain, use the following syntax:

stsadm –o setproperty –pn peoplepicker-searchadforests –pv [list of forests or domains] -url [WebApp]

Specify user account and password from a one way trust

To specify the user name and password from a one-way trust, so that People Picker can look up this information, use the following syntax:

stsadm -o setproperty -url http://[server:port] -pn peoplepicker-searchadforests -pv "forest:contoso.corp.com;domain:bar.contoso.corp.com", [LoginName], [Password]

Ref: http://technet.microsoft.com/en-us/library/cc263460.aspx

-------------------------------------------------------------

Examples

To create a custom filter that searches for the user "David" in the Active Directory in the Contoso domain, use the following syntax:

stsadm -o setproperty -url http://contoso -pn "peoplepicker-searchadcustomfilter -pv (
(Title=David))

To view the current setting for the searchadcustomfilter property, use the following syntax:

stsadm -o getproperty -url http://server_name -pn peoplepicker- searchadcustomfilter

Ref: http://technet.microsoft.com/en-us/library/cc263452.aspx

-------------------------------------------------------------

The following table describes the peoplepicker properties.

Property name Description

Peoplepicker-activedirectorysearchtimeout

Configures the timeout when a query is issued to Active Directory.

Peoplepicker-distributionlistsearchdomains

Restricts the search of a distribution list to a specific subset of domains.

Peoplepicker-nowindowsaccountsfornonwindowsauthenticationmode

Specifies not to search Active Directory when the current port is using forms-based authentication.

Peoplepicker-onlysearchwithinsitecollection

Displays only users that are members of the site collection.

Peoplepicker-searchadcustomquery

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

Peoplepicker-searchadforests

Permits a user to search from a second one-way trusted forest or domain.

Ref: http://technet.microsoft.com/en-us/library/cc263318.aspx

-------------------------------------------------------------

The Check Names function does not honor the Peoplepicker-onlysearchwithinsitecollection setting in Windows SharePoint Services 3.0

Ref: http://support.microsoft.com/kb/967135

-------------------------------------------------------------

Configure connections to Profile Services

Updated: 2009-03-26

In this article:
• Add import connections
• Configure import connections
• Configure user profiles

Personal information about the users in your organization is stored in directory services and line-of-business applications and imported to the user profile store so that it can be used to present personalized or targeted content in sites, and to search for people in your organization.

When the administrator of the Shared Services Provider (SSP) configures user profile imports, the import connections necessary for those settings are configured automatically except for custom connections. Custom import connections must be configured separately.

Add import connections

The administrator of personalization services for the SSP configures import connections, adding accounts for all users who are sharing personalized information by using the SSP. In deployments that have groups of isolated users, personalized information is isolated by using multiple SSPs. In deployments that have multiple SSPs, the SSP administrator must add connections between SSPs.

Connections to directory services can include Active Directory directory services and Lightweight Directory Access Protocol (LDAP) directory services. You can add a connection to the Business Data Catalog, but it is recommended that you first add import connections for directory services.

Most of these connections are configured automatically when import settings are configured. You can change the default configuration options or add custom import connections.

Use the following procedure to add an import connection.

Configure user profiles

You can add properties to user profiles other than those that are imported from directory services and the business data catalog. These properties can be mapped to existing properties so that their values can be automatically updated during profile imports.

During initial deployment, add the additional properties that you identified during user profile planning.

Use the following procedure to add properties to user profiles.

Ref: http://technet.microsoft.com/en-us/library/cc263320.aspx

-------------------------------------------------------------

I would like to validate a People Editor field. I have tried using the property Allow Empty, but unfortunately it doesn’t work. I have used a Required field validator. Luckily it works to some extent. But the problem starts if there is any post back happening on the page. After the post back, it takes the value to be empty even if there is an entry in the control.

Could anyone help me if there is any particular property to be enabled or any other solution to achieve the validations on People Editor Control

• I had the exact same problem on a custom application page.

I solved it with a Custom Field Validator using client side validation

[script language="javascript"]

function CheckProjectManager(source, arguments) {

if (aspnetForm.ctl00_PlaceHolderMain_ProjectManager_downlevelTextBox.value == "")

arguments.IsValid = false;

else

arguments.IsValid = true;

}

[/script]



[SharePoint:PeopleEditor

ID="ProjectManager"

AllowEmpty="false"

ValidatorEnabled="true"

MultiSelect="false"

runat="server"

SelectionSet="User"

Width="200px"

TabIndex="2" /] 

[asp:CustomValidator

ID="rfvProjectManager"

runat="server"

ControlToValidate=""

ErrorMessage="Required"

Enabled="true"

ClientValidationFunction="CheckProjectManager"]

[/asp:CustomValidator]

Note that the ControlToValidate on the CustomValidator is set to ""

The ID for the People Editor ctl00_PlaceHolderMain_ProjectManager_downlevelTextBox was found using IE Developer Toolbar, Note that downlevelTextBox contains the validated userid e.g. DOMAIN\USERID after pressing check user in the peopleeditor.

/Jan Lange

Ref: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/7ea35995-b907-48a4-8a44-cfbd7b549b2b

-------------------------------------------------------------
Non-Microsoft Article
******************************************
Ref: http://vspug.com/dwise/2008/05/01/inside-the-sharepoint-people-picker/

Inside the SharePoint People Picker
SharePoint provides a handy control commonly known as a "people picker" that allows users to search for and select users defined at some specified scope. This control is normally associated with Personnel field in a SharePoint List. However, what happens when you need to add this functionality to some custom component and need to access it programmatically? It gets a lot more complicated!

This article is meant as more of a repository of knowledge that I've discovered while working with this control rather than a "how-to". If you are looking for How-To articles, try these: Eric Kraus or SharePoint Tips. Likewise, please let me know if you have any additional information about the actual workings of this poorly documented control.

Where to find the control
The control is actually called a "PeopleEditor" and is in the 'Microsoft.SharePoint.WebControls' namespace. You will need to add a reference to 'Microsoft.Sharepoint.dll' to your project in Visual Studio, which is something you probably already have if you are writing anything that works with SharePoint.

What is it?
The PeopleEditor is simply a standard UserControl with it's own hierarchy of elements. If you were to walk the tree of controls used, you would see the structure shown below (control IDs are in green italics).

Microsoft.SharePoint.WebControls.PeopleEditor
|-System.Web.UI.HtmlControls.HtmlInputHidden (hiddenSpanData)
|-System.Web.UI.HtmlControls.HtmlInputHidden (OriginalEntities)
|-System.Web.UI.HtmlControls.HtmlInputHidden (HiddenEntityKey)
|-System.Web.UI.HtmlControls.HtmlInputHidden (HiddenEntityDisplayText)
|-System.Web.UI.WebControls.Table (OuterTable)
|- |-System.Web.UI.WebControls.TableRow
|- |- |-System.Web.UI.WebControls.TableCell
|- |- |- |-System.Web.UI.WebControls.Table
|- |- |- |- |-System.Web.UI.WebControls.TableRow
|- |- |- |- |- |-System.Web.UI.WebControls.TableCell
|- |- |- |- |- |- |-System.Web.UI.HtmlControls.HtmlGenericControl (upLevelDiv)
|- |- |- |- |- |- |-System.Web.UI.WebControls.TextBox (downlevelTextBox)
|- |- |-System.Web.UI.WebControls.TableCell
|- |- |- |-System.Web.UI.WebControls.HyperLink (checkNames)
|- |- |- |-System.Web.UI.LiteralControl
|- |- |- |-System.Web.UI.WebControls.HyperLink (browse)
|- |- |- |-System.Web.UI.LiteralControl
|- |- |- |-System.Web.UI.HtmlControls.HtmlInputButton (CreateItem)
|- |-System.Web.UI.WebControls.TableRow
|- |- |-System.Web.UI.WebControls.TableCell
|- |- |- |-System.Web.UI.WebControls.PlaceHolder
|- |- |- |- |-System.Web.UI.WebControls.Label (errorLabel)
|- |- |- |- |-System.Web.UI.WebControls.Table
|- |-System.Web.UI.WebControls.TableRow
|- |- |-System.Web.UI.WebControls.TableCell
|- |- |- |-System.Web.UI.WebControls.Label

Of particular interest are upLevelDiv and downlevelTextBox as those are the controls used when a person is manually entering a name.
*****************************************

No comments:

Post a Comment