Information on how the user's photo is synched with SharePoint User Profile service from Azure AD, Exchange Online, and on-premise AD.
Hi friends, let us see some of the scenarios where a user's photo is synced and shown in SharePoint Online.
SharePoint Online Users with Exchange Online
Some organization will have all their services in cloud-like Active Directory, CMS system, Email etc. When the users have both SharePoint and Email online, the photo of the user is fetched from the exchange online profile and stored in the User Profile Library with 3 different sizes as small, medium, and large thumbnail photos. The synchronization between the exchange profile photo and the SharePoint UPS photo is auto.
Note: The picture is synced with Exchange Online only one time every 24 hours. The photo synced is common to all the M365 Services.
The diagram illustrates how the photo sync works for users with Exchange Online. It is taken from the Microsoft site.
SharePoint Online Users without Exchange Online
What if the organization have only purchased SharePoint Online and maintaining the email from their on-premise setup? How the photos are synced in SharePoint UPS? The answer is a Big Noooo. There is no direct synchronization built. Users have to upload their photos directly to their UPS page or they can use their delve profile page to upload the photos.
This illustrates the photo sync without exchange online. The diagram is taken from the Microsoft site.
SharePoint Online User with AAD synced with On-Premise AD
Some organization may sync their local AD to Azure AD and import all the user information including a photo to Azure AD. But the concern it is not synced automatically with SharePoint UPS. But if you are accessing SharePoint pages, you may see your initials or photo. This is because the photos are fetched from the Azure AD using the MSGraph API. Once the pictures are updated in Azure AD, it is updated in Delve and may be shown in SharePoint pages too, but when you try to get the User Photo URL from SharePoint UPS, it might return empty or the placeholder image URL.
In order to sync the profile pictures from Azure AD or from any other source repo, you can use the below solution provided by the PnP team to update the photo in SharePoint UPS, which still works for both SharePoint On-premise and also for SharePoint Online.
The solution takes care of creating all the thumbnails and also map the picture to the user properties. The downside of this solution is that it cannot be used by business users or Site administrators. It has to be done by the SharePoint administrators who has a higher privilege and also knows how to execute the command line tools.
Note: Soon there will be a new release to the PnPWebparts samples on user profile photo sync from Azure AD to SharePoint UPS using SPFx web part which can be used by the business users or site administrator with no-code experience.