• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Technology
    • Development
    • Hardware
    • Intune
    • Microsoft
    • Office
    • Office 365
    • Security
    • SharePoint
    • Software
    • SQL server
  • Personal development
    • Blog
    • Career
    • Freelancer
    • Knowledge
    • NEWS
    • Private
    • Thoughts
  • Consulting services
  • Contact me

Not only IT

About life, IT and other things...

Home » Technology » Office 365 » User Photo in Office 365 – how to solve problems?

User Photo in Office 365 – how to solve problems?

January 28, 2016 By Tomasz Szulczewski 2 Comments

User Photo in Office 365 it’s a problem that was driving me crazy for the last few weeks, even I wrote a lot of posts on the official Microsoft forum. This one is based on personal experience of the last few weeks when I was doing our local Active Directory integration with Office 365 and Azure AD. I am SharePoint guy and I just wanted to present my users photos in SharePoint. Unfortunately for some reasons user photos which were existing in my local active directory on-premise installation didn’t appear in SharePoint online. Our local support says that everything is perfect. Unfortunately, there was a problem.

This is my account in our on-premise AD

My AD Photo
My AD Photo

But when I displayed my user in Office 365 there was no my photo

my Office 365 Photo
my Office 365 Photo

 

So what’s the problem with User Photo in Office 365?

Well, in the case of user photo synchronization between on-premise Active Directory and Office 365 we have considered a few things:

  • user photos from local AD will not appear in all application of Office 365 in the same time!
  • first place where user photo appears is Exchange online
  • To present user photo from local AD photo size must be less than 10KB
  • If there’s no user photo in Exchange online it will not appear in SharePoint online too…
  • If we have photo in Exchane online we have to start sync process to SharePoint online

 

How to force sync process to SharePoint online

Everything seems to be simple but sometimes it doesn’t work as it should. Even as tenant administrators we can’t start synchronization in the Office 365 interface of user photo to SharePoint online.

To start the synchronization process each user should go to my sites or Delve. Also, user can do the following steps:

About me > press photo  > Change photos > we are changing photos in Edit Details >

Usually, it works. If we have a problem we can try the following steps to get User Photo in Office 365:

  1. Go to SharePoint Online Admin Center in Office 365 admin portal> User profiles
  2. In People we select ‘Manage User Profiles’
  3. We are looking for the user who has a problem
  4. Let’s edit user profile and search for Picture Exchange Sync State
  5. Picture Exchange Sync State – change to 0, delete photo and save
  6. Picture Exchange Sync State – change to 1, save and check the result

It’s worth remembering which has a very important impact on our solution. According to Technet thumbnailPhoto property is synchronized between Azure AD and Exchange Online only one time! All later changes in our on-premise AD will not be sent to  Exchange Online.

Well, we still can use PowerShell

Connect to Exchange online:

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

We can change user photo with following command (base on Technet):

Set-UserPhoto "Paul Cannon" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\Administrator\Desktop\PaulCannon.jpg"))

Unfortunately this option described on Technet site in not accurate. If you get an error just like below you have to update your script

Error on proxy command ‘Set-UserPhoto -PictureData: …
‘False’ to server DB5PR07MB1368.eurprd07.prod.outlook.com: Server version 15.01.0390.0000, Proxy method PSWS:
Request return error with following error message:
The remote server returned an error: (413) Request Entity Too Large…
+ CategoryInfo          : NotSpecified: (:) [Set-UserPhoto], CmdletProxyException
+ FullyQualifiedErrorId : Microsoft.Exchange.Configuration.CmdletProxyException,Microsoft.Exchange.Management.RecipientTasks.SetUserPhoto
+ PSComputerName        : outlook.office365.com

In our script, we have to update the parameter -ConnectionUri. As you can see I added the option ?proxyMethod=RPS  . Also before we can use our photo we should encode it into variables.

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxyMethod=RPS -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -AllowClobber -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
$user1 = ([Byte[]] $(Get-Content -Path C:\1\Tomek1.jpg -Encoding Byte -ReadCount 0))
set-userphoto -identity user@domain.anme -picturedata $user1
Remove-PSSession $Session

And that’s all. I hope that this short post will help you to solve problems with user Photo in Office 365 during local Active Directory and Office 365

Related

Filed Under: Office 365 Tagged With: Azure, Office 365

About Tomasz Szulczewski

I've got more than 20 years of IT experience. IT is my passion and I am still increasing my skills. I work as a SharePoint, Office 365 and Azure architect.

Reader Interactions

Comments

  1. kimryan318 says

    September 23, 2016 at 3:34 pm

    This is the most clear explanation of how the User Photo synchronization works in SharePoint Online, User Profiles, that I’ve read so far! It solved some problems that I have been struggling with. Thanks!

    Reply
  2. Brian says

    July 7, 2017 at 9:07 am

    Fantastic, I tried so hard to solve this problem, and now with your help I’ve completely solved it. Thank you so very much.
    Brian.

    Reply

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Join the Newsletter

Social media

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Search this site

Sign up for Wise accounts

Signup and earn $25

payoneer
payoneer

My latest achievement

Microsoft 365 Certified: Enterprise Administrator Expert
Microsoft 365 Certified: Enterprise Administrator Expert

Tags

Azure Azure Active Directory BizSpark Blog career Certification cloud conference edge freelance Freelancer Hardware home office InfoPath Intune Knowledge licensing Microsoft Microsoft 365 News Office Office 365 Personal development Power virtual agent Private security SharePoint SharePoint designer SharePoint online Software SQL server upwork Windows Windows 365 yammer

Footer

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright © 2022 Tomasz Szulczewski