In this blog, I will explain how to find users using ClientPeoplePickerSearchUser class. There are many ways in CSOM to get the users from SharePoint site or the web but I could not find any proper way to perform a wildcard search of users from SharePoint site using CSOM. For example, let’s say I want to find all the users present in the site collection where the first name starts with “John” or the last name starts with “Patt”.

This below-mentioned code sample will help us to perform both wildcard and explicit search. The output will be matching the result whether it is a collection of users or a single user.

The script for this is given below.

In this example, I am getting the values in a JSON String format. Then, I am converting it into an object and by looping the collection, we can get the required information of the users like loginname, displayname, email etc.

Conclusion

In this blog, I have explained how you can get multiple users based on wildcard search. I hope this information will help you out in a few scenarios.

SharePoint 2013 Hosting Recommendation

HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options

recommended windows hosting