Can I update the profile picture of SharePoint Online users programmatically?

I want to update profile pic so that the profile pic converted into 3 different resolution and uploaded into /User Photos/Profile Pictures/ library of host Mysite site collection


I found the PowerShell script which will update the profile picture of Delve user in SharePoint Online from here.

The script is:

$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
| improve this answer | |
  • 1
    Great answer :) , can you accept it as well so that it won't show up in the unanswered section ? Thanks :) – Gautam Sheth Jun 6 '17 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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