I've ran into the exact same issue. After 2 days of troubleshooting, i found the issue - cmdlet set-userphoto has been deprecated:
I'm currently working on using Graph PowerShell now
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I constantly get this error on PowerShell when trying to upload photo for users -
Write-ErrorMessage : A server side error has occurred because of which the operation could not be completed. Please
try again after some time. If the problem still persists, please reach out to MS support.
At C:\Users\adminfo\AppData\Local\Temp\tmpEXO_evcle4qo.x4j\tmpEXO_evcle4qo.x4j.psm1:1204 char:13
Write-ErrorMessage $ErrorObject
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
***moved from Windows / Windows 11 / Accounts, profiles, and login***
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I've ran into the exact same issue. After 2 days of troubleshooting, i found the issue - cmdlet set-userphoto has been deprecated:
I'm currently working on using Graph PowerShell now
Hi,
How did you upload the photo? Can you post the full script?
According to the error message, this is more of a server-side error than a Windows PowerShell issue. Open the Settings app and navigate to System > Storage > Temporary files to clean the temporary files, then try again to see if the issue persists.
$Name = [Microsoft.VisualBasic.Interaction]::Inputbox("Enter UPN:")
$Location = [Microsoft.VisualBasic.Interaction]::Inputbox("Select Picture:")
Set-UserPhoto -Identity $Name -PictureData ([System.IO.File]::ReadAllBytes($Location)) -confirm:$false
Set-UserPhoto -Identity "John Smith" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\Administrator\Desktop\JohnSmith.jpg"))
I've cleared the files, the error also comes up on a different machine.
Hi,
How did you upload the photo? Can you post the full script?
According to the error message, this is more of a server-side error than a Windows PowerShell issue. Open the Settings app and navigate to System > Storage > Temporary files to clean the temporary files, then try again to see if the issue persists.
having the same issue