setting default user picture for local users?

bentoms
Release Candidate Programs Tester

Hi guys,

Any idea how to set all local accounts Login Window user icon?

For nw accounts, i swap out  /System/Library/CoreServices/SecurityAgentPlugins/loginwindow.bundle/Contents/Resources/DefaultUserIcon.tiff with my company one.. but can't seem to see how to do this for local accounts?

Would emptying the user pictures folder work?

It's a small thing.. but a nagging one!

Regards,

Ben.

10 REPLIES 10

jarednichols
Honored Contributor

You could probably run a script that would modify all the user accounts with dscl. If I do a

dscl . -read /Users/jared

There's an entry for:

Picture: /Library/User Pictures/Flowers/Lotus.tif

You should be able to easily modify it to whatever image file you want.

j
---
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436

bentoms
Release Candidate Programs Tester

Thanks.. where will that value be written? & where would the template for that file live?

nessts
Valued Contributor II

When you do the dscl . -change /users/jared
That file lives in /var/db/dslocal/nodes/Default/users/jared.plist
But using dscl would be your best bet, as it will make sure to keep directory service up to date with any changes you make.
As to where the template for that lives, that is still a mystery to me.
--
Todd Ness
Technology Consultant/Non-Windows Services
Americas Regional Delivery Engineering
HP Enterprise Services

norett
New Contributor

hi there,

i'm also trying to change a local user account picture through command.

Let me explain why : I want to change all my machines admin account picture with one of my own and because I have several machines i want to automate this with a script.

I tried many things, and the oe below seems to work but not all the time, wonder why...

In Terminal :

su #my admin username...)
password #enter your password

dscl . -append "/Users/admin" picture "/Library/User Pictures/Animals/Cat.tif"

where admin is the local account you want to change the picture of and cat the new picture.

It seemed to work on 10.6.8, do you have any other clues ?

thanks a lot

stevewood
Honored Contributor II
Honored Contributor II

I use a multi-step process for this via my postinstall script, but you could do it in any script.

First step is to install the image I want to use (in my case it is an image of our company logo). Second is to do some dscl magic:

dscl . delete /Users/admin jpegphoto
dscl . delete /Users/admin Picture
dscl . create /Users/admin Picture "/Library/User Pictures/Integer/integeruser.tif"

I found that by first deleting the keys and then re-creating them it works much better.

norett
New Contributor

hi there,

doing that from my admin I get this :

par57yr03360:~ admin$ dscl . delete /Users/admin jpegphoto
par57yr03360:~ admin$ dscl . delete /Users/admin Picture
par57yr03360:~ admin$ dscl . create /Users/admin "/wunderman.tif"
<main> attribute status: eDSPermissionError
<dscl_cmd> DS Error: -14120 (eDSPermissionError)

stevewood
Honored Contributor II
Honored Contributor II

You would need to sudo those commands. I run those from a script pushed by Casper, so they run as root. If you want to run them from the terminal by hand, you'd want to run:

sudo dscl . delete /Users/admin jpegphoto
sudo dscl . delete /Users/admin Picture
sudo dscl . create /Users/admin Picture "/wunderman.tif"

norett
New Contributor

even with a sudo before, and even logged in as root it doesn't work on a 10.6.8 :(

The image permissions are everyone Read and write... in the folder Animals of /library/user pictures ..

whats wrong ?

norett
New Contributor

check ou this post :

https://jamfnation.jamfsoftware.com/discussion.html?id=4332

Buscher
New Contributor II

I am trying to do this as well and in the samples shown in this post the user name is known. So how does this set to everyone (IE all computers) in district not matter who the user is?