Posted by Adam Buenz
Using SharePoint User Profiles is an exceedingly influential option when working with additional SharePoint user data. One impressive method is the GetPeers() method which as the name implies, allows you to query down into user peers from a profile object. The GetPeers method returns an array of User Profile objects, which you can later iterate through in order to perform whatever operations you desire. For my particular example, I was writing hierarchal user data, so coupled the GetPeers() method with the GetManager() method to build visual representation of organizational hierarchy.
C#:
-
public List<UserProfile> GetUserProfilePeerData(string url)
-
{
-
SPSecurity.CatchAccessDeniedException = false;
-
{
-
foreach (UserProfile profile in manager)
-
{
-
foreach (UserProfile peerProfile in profile.GetPeers())
-
{
-
peerProfiles.Add(peerProfile);
-
}
-
}
-
}
-
return peerProfiles;











July 27th, 2008 at 5:22 pm
[...] Getting SharePoint User Profile Peers [...]
December 5th, 2008 at 9:44 am
I am trying to do something along the same line. I am trying to write an Custom Organizational Hierarchy webpart of my own. I was wondering if you could pass along some advice on how to go about doing this
Thanks
May 20th, 2009 at 11:52 am
How do you get a list of all users.I am trying to populate a dropdown of users with an action based on selection.
Thx