Core.ProfilePictureUploader - Bulk Upload user profile pictures Tool issue

Shri-6058 326 Reputation points

I am trying to run the tool from here: for bulk user profile pictures. I downloaded the project and I am able to build without any issues however I get a runtime error stating that "Failed to upload thumbnail picture to SPO. Currently my employee pictures are hosted site. I am trying to associate and pass using email and picture url(the csv file supported this scenario). Every single configuration seems to be just fine. I run it via comman line and ensure SPO is connected prior to running . Please advise.


SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,297 questions
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,258 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,596 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 33,641 Reputation points Microsoft Vendor

    Hi @Shri-6058 ,
    This error description says that an object that is being called to get or set its value has no reference. This means that you are trying to access an object that was not instantiated. We need to confirm if we have the access to pic with the url. Please check do we have the permission to the pic.

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  2. Shri-6058 326 Reputation points

    Thanks @RaytheonXie_MSFT . The sync is working only for self. Even though I have SharePoint Administrator role, I am not able to update for others. Using this tool. Is there any other restrictions updating the custom properties or existing properties via this tool?
    Currently I am focusing on pictureURL as I need to bring all employee pictures for the Employee directory tool. Please help.

  3. Shri-6058 326 Reputation points

    Thank you again, yes the picture format is updated with the same format and its listed in CSV file in the form of User4 scenario.
    If I add my email at the beginning, it works fine for myself and then start throwing error for others stating I cant update for others.

    0 comments No comments

  4. Shri-6058 326 Reputation points

    I think I dont have any error with the code and just that there might be some limitation or bug with PeopleManager object? When I run the tool, it completes successfully and updates the property values of mine including picture properties. However as soon as the code picks the other user, it throws error as soon as context.ExecuteQuery() performs and stating I'm not authorized to perform property update for other users. (Where as I am global administrator, sharepoint administrator). Has anyone come across this issue? Please let me know how to fix.


    0 comments No comments

  5. RaytheonXie_MSFT 33,641 Reputation points Microsoft Vendor

    Hi @Shri-6058 ,
    The user profile might be set as 'only the user can change this photo.' like following pic

    This might cause the issue of permission .
    Login to the SharePoint admin center page
    Select user profile from left side global navigation
    Click on manage user profile and enter the username where you wanted to change the profile pic, see the below image for more details.
    Edit the user properties and scroll down the page. Here you will find the option to make available the upload of a user's profile pic. (Only user can change this photo)
    To fix this, Scroll through the profile until you locate the field, Picture Exchange Sync State
    change this field to 0 (or delete the value that is there) and then Save the profile.
    Now, you return to the profile you should find the ability to upload a new photo for that user.

    0 comments No comments