Core.ProfilePictureUploader - Bulk Upload user profile pictures Tool issue

Shri-6058 326 Reputation points
2021-09-20T04:14:31.383+00:00

Hello,
I am trying to run the tool from here: https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-user-profile-pictures-sample-app-for-sharepoint 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.

133407-image.png

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
1,785 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
7,029 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,430 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 19,801 Reputation points Microsoft Vendor
    2021-09-20T08:22:20.16+00:00

    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
    2021-09-29T17:30:23.75+00:00

    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
    2021-09-30T18:22:29.2+00:00

    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
    2021-10-01T21:37:16.047+00:00

    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.

    137026-image.png

    0 comments No comments

  5. RaytheonXie_MSFT 19,801 Reputation points Microsoft Vendor
    2021-10-04T06:21:57.763+00:00

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

    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.
    137276-image.png
    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
    137327-image.png
    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