Question

Bulk Update User Profile Picture on-prem and online

  • 2 August 2023
  • 5 replies
  • 127 views

Badge +3

We are currently using Nintex Workflow for our on-prem SharePoint 2019 Farm.  We will be migrating to SPO soon.  I have been tasked with figuring out how to update the User Profile Picture for all employees both on-prem and online.  We currently don’t have a federated AD so updating AzureAD won’t work for on-prem.

Does anyone know if NIntex Workflow can do this?  I know I can update a user profile property and supply a picture URL, but that doesn’t implement the default picture upload, which creates 3 different sizes.  It only references the url supplied.

Any recommendations are appreciated.

 


5 replies

Userlevel 2
Badge +7

Hi, if there is a web service on MS side, we could do it, I think. 

Can you take a look at the graph explorer (https://developer.microsoft.com/en-us/graph/graph-explorer) here you can a lot of function which we then could use via the Action “Call a webservice” in SPO or Automation Cloud.

 

cheers

 

Sven

Badge +3

On prem 2019 does not have “graph”.  As I mentioned, I can update the PictureUrl User Profile property but that doesn’t reformat the picture in the 3 different formats that SP requires.  I may have to write my own program to do this. 

After more research, User Profile pictures are stored in the [MySite App Url]/User Photos/Profile Pictures/

They are stored in the following formats: 

[loginname]_SThumb.jpg  300x300 or less

[loginname]_MThumb.jpg  72x72

[loginname]_LThumb.jpg   48x48

I haven’t been able to find a web service to update on-prem user profiles in bulk.  I think I can upload all of the photos to the user profile photo path, and then update the property to the correct url.  

I am going to investigate graph for SPO updating.  I did find a PNP sample that does a bulk update for SPO but it is a compiled EXE so not possible with Nintex.  

I’m continuing to research...

Badge +3

I found a Graph api call I may be able to use: 

PATCH /me/photo/$value
PATCH /users/{id | userPrincipalName}/photo/$value

PUT /me/photo/$value
PUT /users/{id | userPrincipalName}/photo/$value
const options = {
authProvider,
};

const client = Client.init(options);

const stream = Binary data for the image;

await client.api('/me/photo/$value')
.put(stream);

I’m going to play around with this and if I find a solution, I’ll post it here.

Userlevel 5
Badge +20

Hi @rei_dipetersen 
Please let us know if the graph you found worked for you? 

Badge +3

I never got this to work.  Still trying to figure it out.

Reply