How to Resolve Missing User Profile Photos in SharePoint PnP People Web Part

How to Resolve Missing User Profile Photos in SharePoint PnP People Web Part

The PnP People web part in SharePoint is widely used for displaying team members, making it an essential feature for organizations aiming to boost visibility and connectivity across teams. However, a common issue is missing user profile photos, which can diminish the overall user experience and visual appeal. This article dives into the reasons behind this problem and provides a step-by-step solution to ensure profile photos appear as expected.


Why Are User Profile Photos Missing?

User profile photos may be missing for several reasons, including:

  • Permissions Issues: Lack of permissions to retrieve user profile images.
  • Sync Problems: Incomplete synchronization between Azure Active Directory (AAD) and SharePoint.
  • Web Part Configuration: Incorrect or missing configuration settings in the PnP People web part.
  • Caching: Caching issues on the client or server side.


Step-by-Step Solution

Step 1: Verify Azure Active Directory (AAD) Synchronization

Ensure that profile photos in AAD are correctly synchronized with SharePoint. Check the User Profile Sync settings in the SharePoint admin center, making sure synchronization is enabled and functioning.

Step 2: Set the Correct Permissions

Permissions are crucial for loading profile images. Check that the PnP People web part has access to user profile information, particularly for external sharing. Also, verify permissions in Azure for the SharePoint Online Client.

Step 3: Adjust PnP Web Part Settings

If the images are still not appearing:

  1. Open the PnP People web part.
  2. In the web part settings, ensure the People Picker Source is set correctly.
  3. Verify that the Image Field Mapping is pointing to the correct user photo property.

Step 4: Clear Browser and SharePoint Cache

  • Clear your browser’s cache or test the People Picker web part in an incognito window to avoid cached data.
  • In SharePoint, navigate to the Site Settings and under Search, select Indexing. Click Re-index Site to force SharePoint to recrawl content, including profile photos.

Step 5: Check for Customization Conflicts

If you’ve added customizations, they might be interfering with the photo rendering. Test by temporarily removing custom code to see if the photos appear.

Step 6: Manually Update Profile Photos (if necessary)

In some cases, re-uploading or refreshing the user photos in AAD can help. Navigate to Microsoft 365 Admin Center > Users > Active Users, select a user, and upload their photo again to reset the sync.

Step 7: Update User Profile Photo in Delve

  • Instruct the user to access their Delve Profile. (They can do this by visiting https://[YourTenantName]-my.sharepoint.com/person.aspx and clicking on their profile image.)
  • Ask them to re-upload their profile photo in Delve. This triggers synchronization with SharePoint Online.


Steps to Manually Sync User Profile Photos in SharePoint PnP People Picker

If the user profile photo is not syncing in the SharePoint PnP People Picker, setting the “Picture Exchange Sync State” value to 1 in the User Profile Properties can help trigger the sync process without using PowerShell. Here’s how to do it:

  1. Navigate to the SharePoint Admin Center Go to the SharePoint Admin Center in Microsoft 365.
  2. Access User Profiles Under More features, find User Profiles and select Open.
  3. Manage User Profiles Select Manage User Profiles to open the profile management view. Search for the specific user whose profile photo needs syncing.
  4. Edit User Profile Properties Click on the user's profile and select Edit My Profile.
  5. Set “Picture Exchange Sync State” to 1 Locate the Picture Exchange Sync State property and set its value to 1. This value tells SharePoint that the profile photo needs syncing with Azure AD.
  6. Save Changes Save the changes, and give SharePoint some time to sync the profile photo with the PnP People Picker.

This setting will trigger the photo synchronization automatically, usually within a few hours.


Steps to Sync User Profile Photos in SharePoint PnP People Picker using PowerShell command

To sync user profile photos in the SharePoint PnP People Picker using PowerShell, follow these steps. This approach requires SharePoint Online Management Shell and PnP PowerShell Module. You’ll need administrative permissions in SharePoint to proceed.

Install and Import the Necessary Modules

If you haven’t already, install the required modules. Run the following commands:

Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Force -AllowClobber
Install-Module -Name PnP.PowerShell -Force -AllowClobber        

Connect to SharePoint Online

Connect to your SharePoint Admin site using the SharePoint Online Management Shell:

Connect-SPOService -Url https://[YourTenantName]-admin.sharepoint.com        

Update the User Profile Property for Syncing Photos

The Picture Exchange Sync State property indicates the state of the profile picture sync. By setting this property to 1, we signal SharePoint to re-sync the profile photo from Azure AD.

To set this property, use the following steps:

# Connect to the SharePoint site
Connect-PnPOnline -Url https://[YourTenantName].sharepoint.com -Interactive

# Specify the user email whose profile photo you want to sync
$userEmail = "[email protected]"

# Set the Picture Exchange Sync State property to 1
Set-PnPUserProfileProperty -Account $userEmail -PropertyName "PictureExchangeSyncState" -Value 1        

  • Run a Full User Profile Sync: If the photo still doesn’t sync, consider running a full sync manually. Unfortunately, there’s no direct PowerShell command for this in SharePoint Online, but setting PictureExchangeSyncState to 1 should prompt SharePoint to re-sync the profile picture within a few hours.
  • Verify the Sync in SharePoint: After setting PictureExchangeSyncState to 1, go to your SharePoint page with the PnP People Picker and refresh it to see if the profile photos appear.
  • Clear Browser Cache and Test Again: Sometimes, browser caching might interfere with the display. Clear the browser cache or use an incognito window to see if the updated photos appear.

Additional Tips

  • Run Incremental or Full Synchronization: If photos still aren’t displaying, contact your SharePoint admin to verify synchronization settings in User Profiles under the SharePoint Admin Center.
  • Troubleshoot Permissions: Ensure the PnP People Picker has the necessary permissions to access user profiles.


Final Thoughts

Ensuring that user profile photos are displayed in the PnP People web part is key to creating a personalized, engaging SharePoint experience. At KeyWe, we specialize in resolving common issues like missing profile photos to enhance connectivity and team recognition on your intranet. Our Microsoft services team is ready to help you maintain a seamless, visually cohesive SharePoint environment, enabling your organization to foster better communication and a stronger sense of community.

Partner with KeyWe to elevate your SharePoint experience with our tailored solutions that support your business’s digital transformation goals.

要查看或添加评论,请登录

KeyWe India Private Limited的更多文章