How to import Office365 User photos over 10KB & without CSV in bulk?

 Office 365, Exchange Online, SharePoint Online, Delve, Perumal
Oct 24 2015
Updating user photos in their profile is much important as it helps users to get a good Credibility, Recognition and to brand themselves in Social media such as Yammer or within their organization.

There are cases that users will not have professional photo updated or there is a business policy which enforces users to have professional images updated. Either the case, Admin has to take care in enforcing this. Also there exists limitation for the user photo not to be more than 10 KB.

In this blog, we are going to explore how to add user photo more than 10KB size and in bulk. The steps involved are
  1. Remove the 10KB photo size limitation
  2. Prepare a folder with all users photo
  3. Update the profile photo
The user photos can be viewed in below locations:
  • Outlook Web Access
  • Contact Card
  • Thumbnail in emails
  • Outlook Client
  • Yammer
  • Lync Client
  • SharePoint (People Search / Newsfeed)

The complexity raises here is that the photos updated through SharePoint will not be reflected immediately in SharePoint search results and in Outlook client. Vice versa, if the user updated his photo from OWA / Lync it will not reflect in SharePoint immediately. This is because the images are cached in all systems and it takes time to update it.

The only way to manage this centrally is by using the PowerShell.

Install SharePoint Online Management Shell and connect to exchange using below cmdlet

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Note: To overwrite the limitation of uploading the images with size more than 10KB, you need to use different proxy method (/?proxyMethod=RPS ) to connect your Office 365 in above cmdlet.

Prepare a folder with all Office365 users photo with their username as the filename.

Now we need to encode photo data in to a variable and use it in Set-UserPhoto cmdlet.

$path= 'C:\User images\'
$Images = Get-ChildItem $path
$Images |Foreach-Object{
$Identity = ($_.Name.Tostring() -split "\.")[0]
$PictureData = $path+$
Set-UserPhoto -Identity $Identity -PictureData ([System.IO.File]::ReadAllBytes($PictureData)) -Confirm:$false }
Note: To use the above cmdlet you need to create a folder with user images and rename each images with its Office 365 user name.

Below are the limitation in Office365 user photo update

  • By default, images with size 10 kb alone can be uploaded. Admin has to depend on other tools to edit (Crop, Rotate or Enhance) the user images.
  • GUI for centralize management is not possible. Entirely depends PowerShell script which is complex to use.
  • Need to create user images with user name and execute PowerShell which is a time consuming process and more reviews needed to ensure accuracy.
  • Images uploaded will not be reflected in all systems immediately.

To overcome the above obstacles and make photo collection process easier you can use 'GingerEx for Office 365 Photo Edit'.

You can subscribe for the beta from the below form.