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:
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:
Step 4: Clear Browser and SharePoint Cache
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
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:
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
Additional Tips
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.