I'm trying to change a user's profile picture using PowerShell and I'm receiving the following error:
Error on proxy command 'Set-UserPhoto -Identity:'username_removed'
-PictureData:'255','216','255','224','0','16','74','70','73','70','0','1','1','1','0','72','0','72','0','0','2...
-Confirm:$False' to server ME3P282MB4196.AUSP282.PROD.OUTLOOK.COM: Server version 15.20.4713.0000, Proxy method RPS:
Processing data from remote server me3p282mb4196.ausp282.prod.outlook.com failed with the following error message:
[AuthZRequestId=aa213d1b-1ea1-4b2a-91b0-20d1ee30a6f7][FailureCategory=AuthZ-ArgumentNullException] Value cannot be
null.
Parameter name: source For more information, see the about_Remote_Troubleshooting Help topic.
[Server=MEYP282MB3499,RequestId=3929eae2-fd6c-4892-905d-274c7dd8b8a3,TimeStamp=3/12/2021 5:04:10 AM] .
+ CategoryInfo : NotSpecified: (:) [Set-UserPhoto], CmdletProxyException
+ FullyQualifiedErrorId : [Server=MEYP282MB3499,RequestId=3929eae2-fd6c-4892-905d-274c7dd8b8a3,TimeStamp=3/12/2021
5:04:10 AM] [FailureCategory=Cmdlet-CmdletProxyException] 503E4E16,Microsoft.Exchange.Management.RecipientTasks.S
etUserPhoto
+ PSComputerName : outlook.office365.com
I'm only doing this through PowerShell as a last resort as I received a similar error while trying to change the picture in Microsoft 365, the Azure portal and the user was unable to change it on their end.
edit: These are the commands I was running in PowerShell:
Connect-ExchangeOnline -UserPrincipalName <myemailaddress_removed> -DelegatedOrganization <tenant_id_removed>
Set-UserPhoto -Identity "IdentityRemoved" -PictureData ([System.IO.File]::ReadAllBytes("<path to file removed>"))
edit: I've tried uploading the profile picture to a test account in Azure and it was applied without issue so the trouble seems to be with this particular user's account