Forum Discussion
Set-UserPhoto size of picture?
Thanks Vasil for confirming my experience that photos are a mess in O365.
I will soon receive feedback from the customer regarding the resolution and quality of the photos that I uploaded through powershell and try to explain all the ifs and buts and caveats of photos in O365.
I disagree with the statement that photos are a mess, they work as expected. The issue the original author has is not in the photos, but in a limitation of the Get-UserPhoto powershell command.
As you may note, there is no switch with the command to specify the photo size to retrieve, so the command is simply always retrieving the HR240x240 value.
If you examine the photos available through the Web UI for Outlook, such as:
https://outlook.office365.com/ews/Exchange.asmx/s/GetUserPhoto?email=user@domain.com&size=HR648x648
You will note that all sizes of HR listed here should be retrievable by changing the HR value:
https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/sizerequested
So to summarize as a Best Practices Recommendation:
- Avoid using Active Directory ThumbnailPhotos as a means of replicating photos from on prem to Office 365 as the photo resolution is no greater than 64x64 and the file size is restricted to 10KB.
- For users with an Exchange Online or Skype for Business Online licensing, profile photos should be cropped or resized to 648x648 prior to uploading to Office 365 to ensure proper aspect ratios are maintained when Exchange Online automatically resizes the photos.
- Administrators may upload prepared profile photos for their users with Exchange Online or Skype for Business Online using the Set-UserPhoto command.
- For more restrictive environments, disable the user's ability to modify their profile photo. This can be accomplished with a command: Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -SetPhotoEnabled $false
This process takes an hour or more to complete. - These profile photos will be copied automatically into SharePoint Online for the small, medium, and large photos it stores.
This process is not immediate in some cases, may require up to 72 hours to update. - For users with only SharePoint Online licensing, and no Exchange or Skype, the profile photo will only be stored in SharePoint Online and the previous commands to set the photo are not available to the Administrator.
Most Office 365 deployments include Exchange Online, so this is a limited scenario.