We help IT Professionals succeed at work.
Get Started
Troubleshooting Question

Microsoft 365: remove user photo for all users

Last Modified: 2021-02-21
Hello, we are using M365 at a school and we'd like to keep users from changing their profile photo.

Now, that should already be enable, the problem is many users already had changed their photo.

What I'd need is to remove (not replace) the photo, so that on Teams the icon with initials shows up. Basically, teachers need to see initials all the time while on a Teams meeting.

I tried following a couple of guides to do this with PowerShell and it seems to work with no error, but then I check and the photos are still there.

This is what I did and I thought it had worked:

$Users = Get-AzureADUser | Where {$_.UserType -eq 'Member' -and $_.AssignedLicenses -ne $null}
foreach ($user in $Users) {Remove-UserPhoto -Identity $user.UserPrincipalName -Confirm$false}
Watch Question
IT Consultant, Web Designer
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE