Retrieve User Profile Properties using Client Object Model in SharePoint 2013

I’ve found an interesting link about how to retrieve some properties of user profiles in SharePoint 2013 by using its client object model, like this:

const string serverUrl = "http://serverName/";
const string targetUser = "domainName\userName";
ClientContext clientContext = new ClientContext(serverUrl);
PeopleManager peopleManager = new PeopleManager(clientContext);
string[] profilePropertyNames = new string[] { "PreferredName", "Department", "Title" };
UserProfilePropertiesForUser profilePropertiesForUser =
     new UserProfilePropertiesForUser(clientContext, targetUser,
IEnumerable<string> profilePropertyValues =
foreach (var value in profilePropertyValues)
     Console.Write(value + "n");

You can find more information in:

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.