Please refer to this post of mine on how to configure Forms Based Authentication (FBA) on a SharePoint Web Application using ASP.NET SQL Membership Provider.
After you setup FBA the People Picker control by default will only search for user’s by using the username. However, if you would like to search for users by part or full display name then you will need to carry out the following changes to the Membership Database:
- Add a column “ProfileNames” of type nvarchar(255) in the table: aspnet_Users
- Update the stored procedure: aspnet_Membership_FindUsersByName by replacing the following where clause:
WHERE u.ApplicationId = @ApplicationId AND m.UserId = u.UserId AND u.LoweredUserName LIKE LOWER(@UserNameToMatch)
WHERE u.ApplicationId = @ApplicationId AND m.UserId = u.UserId AND u.ProfileNames LIKE '%' + LOWER(@UserNameToMatch) + '%'
- Create the following Trigger on the “aspnet_Profile” table:
CREATE TRIGGER [dbo].[ProfileProperty_Trigger] ON [dbo].[aspnet_Profile] AFTER INSERT,UPDATE AS BEGIN SET NOCOUNT ON; DECLARE @Names nvarchar(50) DECLARE @UID nvarchar(50) SELECT @Names = p.PropertyValuesString, @UID = p.UserId FROM aspnet_Profile p INNER JOIN inserted i ON p.UserId = i.UserId UPDATE aspnet_Users SET ProfileNames = @Names WHERE aspnet_Users.UserId = @UID END
That is it, after making these changes the People Picker control should now match by username as well as display name.
Please refer to this post of mine on how to configure Forms Based Authentication (FBA) on a SharePoint Web Application.
Consider the following scenario:
You have configured FBA on a Web Application and created a Site Collection that uses FBA. Your Web Application uses mixed mode authentication (FBA and Windows Authentication). When you search for users in People Picker it shows you matches for both FBA and AD users. You would like to restrict People Picker to only show matches for FBA Users.
You can achieve this by running the following stsadm command:
stsadm -o setproperty -pn peoplepicker-onlysearchwithinsitecollection -url http://www.nameOfMySiteCollection.co.uk/ -pv yes
The ‘peoplepicker-onlysearchwithinsitecollection’ part in there is misleading and doesnt really do what it implies, however, it does get rid of the AD user mataches from People Picker.
Please note that if you type in the full username of an AD user and click on the Check Names icon it will still resolve the user.