Hi,
I am trying to access user profile properties using Client Object Model in SharePoint 2013. But, when I am trying to get user properties, I am getting null for all except Title. User properties values are visible on user's site. Please let me know, if I am missing something.
namespace test
{
class Program
{
static void Main(string[] args)
{
string siteURL = "http://mysite";
string accountName = "testuser1";
string userProfileProperty = "Email";
ClientContext clientContext = new ClientContext("http://mysite");
PeopleManager peopleManager = new PeopleManager(clientContext);
ClientResult<string> profileProperty = peopleManager.GetUserProfilePropertyFor(accountName,userProfileProperty);
clientContext.ExecuteQuery();
Console.WriteLine("Account Name: " + profileProperty.Value);
Console.ReadLine();
}
}
}
THanks,
Deepali
Deepali