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
For theAS 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:
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. For the first time itIt removed the image. But on the first run, but when I setuplodaded a new image in the user's profile and runexecuted this cmdlet, it didn't workedwork. Same happened I examined the same behaviour for multiple other usersuser 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?