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

Featured image

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:

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.

​1. Remove the 10KB photo size limitation

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.

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

​3. Update the profile photo

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

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.


Subscribe for BETA


Request New Report