kamagra how much to take

Getting SharePoint User Profile Peers

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.

  1. public List<UserProfile> GetUserProfilePeerData(string url)
  2. {
  3. SPSecurity.CatchAccessDeniedException = false;
  4. List<UserProfile> peerProfiles = new List<UserProfile>();
  5. using (SPSite site = new SPSite(url))
  6. {
  7. UserProfileManager manager = new UserProfileManager(ServerContext.GetContext(site));
  8. foreach (UserProfile profile in manager)
  9. {
  10. foreach (UserProfile peerProfile in profile.GetPeers())
  11. {
  12. peerProfiles.Add(peerProfile);
  13. }
  14. }
  15. }
  16. return peerProfiles;

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>