1

I have a requirement to remove the user photo from Azure AD User profile.

I checked for MS Graph APIs for User Photos. But as far as I know, MS Graph APIs are only available to add/upload photo. There is no such API available to remove the photo. Reference link: https://docs.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-1.0&tabs=http

AS a workaround, I found few articles on internet, where they said to upload default avatar image instead. But by uploading default avatar image, it will not give that default look and feel of initial letters in user image that we get when there is not actually no image available in the profile. Please see the below image for reference: enter image description here

I found one PowerShell cmdlet to remove the user photo. Reference link: https://docs.microsoft.com/en-us/powershell/module/exchange/remove-userphoto?view=exchange-ps

Remove-UserPhoto "Ann Beebe"

But this cmdlet, only worked for the first time. It removed the image on the first run, but when I uplodaded a new image in the user's profile and executed this cmdlet, it didn't work. I examined the same behaviour for multiple other user accounts.

My Question:

Is there any way to remove the users photo from Azure AD user profile programmatically and it will display its default firstname-lastname initials in the image portion?

1 Answer 1

0

yes, as of today this now works. It's not documented yet but works with v1.0 endpoint by calling DELETE https://graph.microsoft.com/users/[email protected]/photo.

Your Answer

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

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