使用CSOM从Sharepoint在线读取userprofile数据非常简单。例如:
string siteURL = @"https://foo.sharepoint.com";
ClientContext ctx = new ClientContext(siteURL);
var securePass = new SecureString();
"password123".ToList().ForEach(s => securePass.AppendChar(s));
ctx.Credentials = new SharePointOnlineCredentials("userName", securePass);
var peopleManager = new PeopleManager(ctx);
var personProperties = peopleManager.GetMyProperties();
ctx.Load(personProperties, p => p.UserProfileProperties);
ctx.ExecuteQuery();
是否可以使用WebClient
或类似内容对本地Sharepoint 2013进行此操作?