How to add the bulk user image to respective email Ids using powershell command

Created by Abhishek Devrani, Modified on Wed, 16 Oct, 2019 at 3:37 PM by Baijnath Kumar

How to add an image of a single user

Adding  the image of a single person is an easy task we have click on the user whom we have to change the image a second tab open click on the change below image box and insert the image it will get uploaded and this is how we can add an image to a user 



Image has been successfully added to the user email Id





The problem arise when we want to upload multiple of the image of multiple of the user then using this method become little hectic task so to make it simple we use the power shell command to added multiple image to multiple user email Ids


How to add multiple images to multiple email ids using PowerShell command


Step 1. First, create an excel sheet with .csv extension  save it userkes.csv in a folder created in c drive with name Pics





Step 2. Create another folder with name picture to store the image to be uploaded in C drive.



Step 3. In .csv file added the detail in user name added email Id and PictureData added the path of the image which you stored in another folder.



Step 4. Using power shell connect to exchange online




Step 5. After connecting with exchange online just run this command


Import-csv c:\Pics\userkes.csv | % { Set-UserPhoto –Identity $_.username -PictureData ([System.IO.File]::ReadAllBytes($_.picture)) -Confirm:$false }


images will get uploaded 



For any further clarification or information on topics related to Office365 and email security reach out to us on https://cloud.foetron.com.You can also visit our website Foetron for any assistance on Microsoft related products.







Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article