People List

Hi,  I'd like to display the photos of everyone who is a member of a SharePoint group.

I've created a simple list displaying the person column with the picture as the attribute.  This works well but if I could get this list updating from the a SharePoint group it would be great as it would require much less admin work.

I've looked at search related web parts but can't find how I can do this.  I'm new to SharePoint and come from an SP admin perspective so any advise will be appreciated.

Using a SharePoint 2013 Enterprise On Prem farm.

October 23rd, 2013 11:31am

Hi Alan,

According to your description, my understanding is that you want to display users with their photos from a specific SharePoint group in your custom list.

I recommend to write code to get the users profile from a specific group to your custom list.

We can write something like this:

SPGroup group = web.Group.GetByName("YOUR GROUP NAME");

UserProfileManager upm = new UserProfileManager(context);

Foreach(SPUser user in group.Users)

{

UserProfile profile = upm.GetUserProfile(user.LoginName);

//get the needed profile to your list

}

Here are some links for you to take a look:

SPGroupCollection.GetByName method: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spgroupcollection.getbyname.aspx

UserProfileManager.GetUserProfile method: http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.getuserprofile.aspx

How to list all users from a sharepoint group c#: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/dcf5acff-78bd-4bfc-afd4-93c2e1cbb894/how-to-list-all-users-from-a-sharepoint-group-c?forum=sharepointdevelopmentprevious

How to fetch User profile picture from Sharpeoint 2010: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/9cc9053c-958f-44a0-86ee-efe74448e3a4/how-to-fetch-user-profile-picture-from-sharpeoint-2010?forum=sharepointdevelopmentprevious

Best regards.

Thanks

Free Windows Admin Tool Kit Click here and download it now
October 24th, 2013 4:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics