So, one of your employees learned how to upload the photo that appears next to their name in Outlook. Now, everyone is uploading glamour shots and pictures of their dogs.
Some of them are uploading their picture upside-down and they can’t figure out how to change it.
These pictures are normally used to identify employees, so treating the company directory like social media can be an annoying distraction.
Here are a couple of commands that you can use to quickly and easily change the profile photos for users.
First, you’ll need to install the Microsoft Graph cmdlet:
Install-Module Microsoft.Graph -Scope CurrentUser
Next, run the following command and login using an account with appropriate privileges:
Connect-MgGraph
Assuming you flew through those steps without errors, you are now ready to perform profile photo magic:
Get the current photo for a user:
get-MgUserPhotoContent -UserId [email protected] -OutFile "C:\photos\user.jpg"
Obviously, you'll need to use the correct user, domain, and file path.
You can modify the image or select a different one. I usually make the image a pretty square shape and crop it nicely. Save it and you're ready to upload!
Upload the better image with this command:
set-MgUserPhotoContent -UserId [email protected] -InFile "C:\photos\user.jpg"
If you received no errors, then you have just performed a small miracle.
It may take several hours - or even a day - for the changes to become active. But, once they're active, the party begins. Well done.