User Profile Default Icon

IT-Chris
New Contributor III

Does anyone know how to change a users picture to a picture I have added to the User Pictures. All the current terminal command lines don't work. (IE Mojave)
I would like to set a default for all users. I have looked for prefrences.plist and still have found nothing. Thanks!!

3 REPLIES 3

maurits
Contributor

The picture is stored in the Open Directory database, usually as a picture in the 'JPEGPhoto' field, or a reference to a picture file in the 'Picture' field.
(note there are some requirements to the type of picture, size and type, test!)

But if you edit it: this should do the trick:

  dscl /Local/Default -write Users/${USER_SHORTNAME} Picture "/Library/User Pictures/Your Liking.tif"

and delete the 'JPEGPhoto'

(a personal side note: why would you like to manage this? Users like to edit this picture, to make a mac more 'personal', which makes them treat the mac better)

IT-Chris
New Contributor III

So I have tried countless times this command and it doesn't work. I use stock images with the same results
I know it stores a binary code in the users Director Editor under the JPEGPhoto filed, but again no command line will easily set the path of the assigned photo.

(These macs are not being assigned as a personal device and the picture is always changeable by the user if they want to change it)

IT-Chris
New Contributor III

update, after playing around deleting the picture using sudo command and -append it all the location of the picture it worked.. maybe need to explore some more.