2

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

  • 1
    Where's your code? Nobody can help you debug it if they can't see it. – Jesse Dec 03 '21 at 05:08
  • Hi Jesse, sorry I didn't think to post the code as it was only two lines in PowerShell. Please see original post. – user17577358 Dec 03 '21 at 05:41
  • What image format is used for that particular user? Did you try opening it in an image editor and re-saving it as .jpg for instance? – Theo Dec 04 '21 at 12:23
  • It started as .jpeg and I tried with a .png and got the same result. I also reduced the dimensions and size a fair bit with no success. I did manage to get Exchange 365 to accept the file after removing the spaces from the file name but Azure still doesn't like it. I can only assume there's some weird attribute specific to this user's profile that is preventing the upload but I can't figure out what it is. – user17577358 Dec 05 '21 at 06:46

0 Answers0