Using the People Picker Editor picker control
Here is some code that demonstrates how to use the SharePoint People picker PeopleEditor control inside a WebPart.

In the code below, note the use of the SelectionSet parameter. It is a comma-delimited string with valid values "User", "SecGroup", "DL", and "SPGroup". You can mix and match these values. SecGroup is an Active Directory Group, and DL refers to an Active Directory Distribution List.
The size of the control is influenced by the Rows property. For single entry, set this property to 1. The screenshot above shows 3 rows.
Also of interest may be the MultiSelect and AllowEmpty properties, whose names should be self explanatory. Both of these properties are booleans.
Another possibility is setting which account source the control should use - "All", "MembershipProvider", "None", "RoleProvider", "UserInfoList", or "Windows." .
public PeopleEditor pplEditor; protected override void CreateChildControls() { base.CreateChildControls(); pplEditor = new PeopleEditor(); pplEditor.SelectionSet = "User,SecGroup"; this.Controls.Add(pplEditor); }
You can read the resolved users and groups that the user has entered by using the editor's ResolvedEntities property, which is an ArrayList containing a list of PickerEntry objects. Each PickerEntry object contains an EntityData property bag which includes a "PrincipalType" field. You can use this to determine whether the resolved entity is a user or group.
foreach (PickerEntity entity in pplEditor.ResolvedEntities) { switch ((string)entity.EntityData["PrincipalType"]) { case "User": // ... do stuff here ... break; } }
You can also include the PeopleEditor control using inline ASP inside aspx pages. For example:
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
...Custom validation
Custom Validation can be implement server-side using standard ASP.NET server validation controls. If you'd like to do so client side validation (for usability, rather than security control) using javascript, Marc D Anderson has posted some sample code. We have not tested this code.
Filtering
The PeoplePicker control can be set to filter using stsadm.exe commands: peoplepicker-searchadcustomfilter and peoplepicker-searchadcustomquery.

