public List<userprofile> GetUserProfilePeerData(string url)
{
SPSecurity.CatchAccessDeniedException = false;
List<userprofile> peerProfiles = new List<userprofile>();
using (SPSite site = new SPSite(url))
{
UserProfileManager manager = new UserProfileManager(ServerContext.GetContext(site));
foreach (UserProfile profile in manager)
{
foreach (UserProfile peerProfile in profile.GetPeers())
{
peerProfiles.Add(peerProfile);
}
}
}
return peerProfiles;
{
SPSecurity.CatchAccessDeniedException = false;
List<userprofile> peerProfiles = new List<userprofile>();
using (SPSite site = new SPSite(url))
{
UserProfileManager manager = new UserProfileManager(ServerContext.GetContext(site));
foreach (UserProfile profile in manager)
{
foreach (UserProfile peerProfile in profile.GetPeers())
{
peerProfiles.Add(peerProfile);
}
}
}
return peerProfiles;
本文介绍了一种方法,用于从指定URL的SharePoint站点获取所有用户的个人资料及其同行数据。通过使用UserProfileManager类,该方法能够遍历站点中所有用户的个人资料,并收集他们的同行个人资料。
61

被折叠的 条评论
为什么被折叠?



