0
我是新的API的&試圖從共享點拉用戶配置文件我使用下面的代碼,但不知道服務器名?域名?和用戶名?我怎樣才能從共享點拉配置文件圖像
const string serverUrl = "http://sharepoint.com/";
const string targetUser = "ttgdev-my.sharepoint.com\\[email protected]";
// Connect to the client context.
ClientContext clientContext = new ClientContext(serverUrl);
// Get the PeopleManager object and then get the target user's properties.
PeopleManager peopleManager = new PeopleManager(clientContext);
PersonProperties personProperties = peopleManager.GetPropertiesFor(targetUser);
// Load the request and run it on the server.
// This example requests only the AccountName and UserProfileProperties
// properties of the personProperties object.
clientContext.Load(personProperties, p => p.AccountName, p => p.UserProfileProperties);
clientContext.ExecuteQuery();
foreach (var property in personProperties.UserProfileProperties)
{
Console.WriteLine(string.Format("{0}: {1}",
property.Key.ToString(), property.Value.ToString()));
}
Console.ReadKey(false);
請指引我,它會給我的錯誤中 {「的屬性或字段‘UserProfileProperties’尚未初始化,它並沒有被要求或請求尚未執行,這可能需要有明確要求。「} 以下行
clientContext.ExecuteQuery();
是它的SharePoint在線或前提? –
不,我想只通過使用此 – user3253756
訪問userprofile圖片什麼不?我只是問你正在使用哪個SharePoint **版本** –