I created a custom property in the user profile. I want to search through all the user profiles and output those profiles in which the custom property contains a certain string

For example:

User1- Custom Property value is 1,2,3

User2- Custom Property value in 2,4,5

User3- Custom Property value is 4,6,8

I want to output all the profiles in which Custom Property contains "2"

(using c# code)

So the output should have User1 and User2

Can someone suggest the best way to implement this? I did find some links in the internet for searching user profiles use KeyWord search but and not sure if those methods could be used to search through Custom Properties. Example: https://www.collaboris.com/how-to-use-search-keywordquery-to-query-user-profiles-in-sharepoint/

I am using SharePoint 2013


I posted answer to the same question which I had posted in stack overflow:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.