1

I am doing Console project to get data from SharePoint using CSOM. I want to use People-picker. I using following code but it returns nothing. Can anyone help?

Microsoft.SharePoint.ApplicationPages.ClientPickerQuery.ClientPeoplePickerQueryParameters query = new Microsoft.SharePoint.ApplicationPages.ClientPickerQuery.ClientPeoplePickerQueryParameters();
            query.AllowEmailAddresses = true;
            query.MaximumEntitySuggestions = 50;
            query.PrincipalType = Microsoft.SharePoint.Client.Utilities.PrincipalType.All;
            query.PrincipalSource = Microsoft.SharePoint.Client.Utilities.PrincipalSource.All;
            query.QueryString = "username";  
            query.WebApplicationID= new Guid("3a9bf856-9541-4bd0-a0e7-8bb5e9357327");
            Microsoft.SharePoint.Client.ClientResult<String> result = Microsoft.SharePoint.ApplicationPages.ClientPickerQuery.ClientPeoplePickerWebServiceInterface.ClientPeoplePickerSearchUser(context,query);
4
  • In Console application you want a control??
    – Gaurravs
    Dec 24, 2015 at 8:45
  • No. I just need list of users for the query string Dec 24, 2015 at 9:42
  • you mean, you need all users from active directory/your site?
    – Gaurravs
    Dec 24, 2015 at 9:47
  • yes, users retrieved as searching in people-picker in my site Dec 24, 2015 at 10:31

2 Answers 2

0

The People Picker in SharePoint 2013 has had a bit of a face-lift. The ‘Verify Address’ and ‘Address Book’ icons are gone and what’s left is a cleaner, simpler interface. But new controls means that some of the older approaches to working with the People Picker no longer work. As usual I’m working with SharePoint 2013 on the client side (CSOM) working with JavaScript and jQuery.

peoplepicker using CSOM and jquery

Refrence : peoplepicker using CSOM and jquery

Note : Blog is not mine , i have refereed it in past and i have got output as i want.

2
  • I am using C#(CSOM). but this blog post is about using Javascript Object Model Dec 24, 2015 at 15:18
  • @Mani OK. . I'll get back to shortly regarding c#(CSOM)
    – Dipen Shah
    Dec 24, 2015 at 15:49
0

It was my mistake. I didn't pull value from the "ClientResult collection". After adding result.Value it returned response.

This code is working fine for SP2013 and SharePoint Online. But not working in SP2010. Any one have idea about it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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