• Skip to content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer

Not only IT

About life, IT and other things...

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
  • Career
    • Blog
    • Freelance
    • Knowledge
    • Personal development
  • Technology
    • SharePoint
    • Office
    • Office 365
    • Development
    • Hardware
    • Software
    • SQL server
    • Microsoft
  • Thoughts
    • All about life
    • NEWS
    • Private
  • About me
    • My Services
    • Contact

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 which was driving me crazy for last few weeks, event I wrote a lot of posts on official Microsoft forum. This one is based on personal experience of 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.

[adblockingdetector id=”5770e6ed85560″]

This 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 case of user photo synchronization between on premise Active Directory and Office 365 we have consider 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 some time it doesn’t work as it should. Even as tenant administrator we can’t start synchronization in Office 365 interface of user photo to SharePoint online.

To start synchronization process each user should go to my sites or Delve. Also user can do 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 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 to remember which has 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 send 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 parameter -ConnectionUri. As you can see I added option ?proxyMethod=RPS  . Also before we can use our photo we should encode it into variable.

 
$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

Share this:

  • Facebook
  • Google
  • Twitter
  • LinkedIn
  • Tumblr
  • Reddit
  • Pinterest
  • Pocket

Related

Filed Under: Office 365, SharePoint 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; SQL Server 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

Newsletter

Follow me online

  • Facebook
  • Google+
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Recent Posts

Genesis Framework

Genesis Framework – why should you use it?

January 30, 2019 By Tomasz Szulczewski Leave a Comment

Someone recently asked me how I do it, that my blog has such a neat appearance and how long I learned PHP. Well, that's just the Genesis Framework 🙂. … [Read More...] about Genesis Framework – why should you use it?

Personal branding for Dummies

Personal Branding for Dummies

December 9, 2018 By Tomasz Szulczewski Leave a Comment

Previously, I wrote to you that I had the pleasure of giving a lecture at Google Campus for Personal Branding. Today I would like to go into details … [Read More...] about Personal Branding for Dummies

Google Campus on stage

Google Campus – my first time

October 28, 2018 By Tomasz Szulczewski Leave a Comment

Well, it happened ... For the first time in my career I had the pleasure to lecture at Google Campus and I will tell you that 's awesome. From time to … [Read More...] about Google Campus – my first time

Footer

Tags

Azure BizSpark Blog career Certification conference freelance Freelancer Hardware InfoPath Knowledge Microsoft News Office Office 365 Personal development privacy Private SharePoint SharePoint online Software SQL server Windows

Recent Posts: Not only IT

Genesis Framework – why should you use it?

Personal Branding for Dummies

Google Campus – my first time

Ignite 2018

Hubfly

Microsoft Teams – What are we talking about?

Migrating File Shares to SharePoint Online

Ignite 2017 dream came true

SharePoint designer workflow – part two

Damaged wan port – save your router

Search

Copyright © 2019 Tomasz Szulczewski

By using this website without changing your browser settings consent to the use of cookies. You can always change your browser settings determining their saving. More information.