2

I am using PowerShell script for updating the User profile properties of nearly 17 items from a Picture library(named 'Employee Details') in a site. All fields get updated except Profile photo.

When I try to update "PictureURL" property, the previous image in my User Profile gets removed, and my new photo didn't gets updated, even though I waited more than 10 hours.

Note: I am updating the user's photo who doesn't have exchange online license. In this case how can I update User photo. Kindly give me the solution to Update user profile photo.

Thanks in Advance!!!

1
  • Did you ever find a solution for this? I'm facing the very same issue and want to update the profile photo of users directly in SharePoint Online user profile using Powershell
    – George
    Jul 28, 2020 at 6:17

2 Answers 2

1

Did you try to update the "PictureURL" property with a link to your picture in "Employee Details"? I think that doesn't work because of a wrong location. It might be possible that your "Employee Details" library is not accessible for everyone in your organisation.

This is not a very clean solution, I guess, but one that works:

  1. Copy your pictures to the "profile pictures" folder in https://tenantname-my.sharepoint.com/User%20Photos

  2. Set the "PictureURL" property to the picture in https://tenantname-my.sharepoint.com/User%20Photos via PowerShell

The thumbnails won't get generated this way.

0

In Office 365 you want to use the Exchange PowerShell to update the Photo.

Set-UserPhoto -Identity "Ruby Golden" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\Administrator\Desktop\Ruby.jpg"))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.