Posted on 02-21-2020 10:42 AM
Hey guys,
So in the midst of setting up our jamf i have a second user profile set up for our Dept to login to every laptop, Is there a way to set a standard profile pic using jamf pro ? Any advise would be great.
Thanks
Posted on 02-24-2020 01:45 PM
I pkg up a .png file and drop it into /Library/Application Support/CompanyName/ProfilePic.png
then run this script on the same policy after the install.
#! /bin/bash
## Written by strayer 6/12/19
## based on https://www.jamf.com/jamf-nation/discussions/3206/setting-default-user-picture-for-local-users
## Set the admin user icon
dscl . delete /Users/admin jpegphoto
dscl . delete /Users/admin Picture
dscl . create /Users/admin Picture "/Library/Application Support/CompanyName/ProfilePic.png"
exit 0
Posted on 07-13-2022 07:15 PM
Thanks for the pointers.. Right now, my icon is deploying however it is not filling up the entire circle... Any ideas? The "icon" image is like 6.5 inches by 6.5 inches... I have experimented but does not seem to fill. Thoughts?
Posted on 03-12-2020 12:08 PM
I use an almost identical method for our users, but for some reason the image appears at the initial FileVault unlock screen when booting the machine, but the icon is just a grey person icon once logged into the OS.
Posted on 06-21-2020 07:25 AM
@morsepacific Hey, I noticed the same behavior ... @strayer any ideas ?
Posted on 06-22-2020 11:38 AM
I haven't seen that one. I've seen the icon disappear but that is because I accidentally overwrote the file on peoples computers with a different policy at one point. I've since rectified that and re-running the policy seemed to resolve that issue.
Posted on 03-30-2021 02:54 PM
@strayer when i use that script it returns this error:
<dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)
delete: Invalid Path
<dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)
delete: Invalid Path
Im on Big Sur. What could be wrong?
Posted on 03-31-2021 06:36 AM
@Philein
Assuming you replaced "admin" with your username and updated the file path to the profile picture you want to use,
If the file path has a space in it make sure the path is in quotes.
I've run the script on Big Sur and it's worked for me so the commands are still valid.
Posted on 04-03-2021 06:15 PM
This goes back a bit. Using dsimport to change the image
#!/bin/bash
username="someUser"
userPicture="/Users/Shared/yourImage.jpg"
## remove existing image references
dscl . delete /Users/"$username" Picture
dscl . delete /Users/"$username" JPEGPhoto
## import new image
if [ -f "$userPicture" ] ; then
mappings='0x0A 0x5C 0x3A 0x2C'
attributes='dsRecTypeStandard:Users 2 dsAttrTypeStandard:RecordName externalbinary:dsAttrTypeStandard:JPEGPhoto'
pictureImport="/Library/Caches/$username.picture.dsimport"
printf "%s %s
%s:%s" "$mappings" "$attributes" "$username" "$userPicture" > "$pictureImport"
# Check to see if the username is correct and import picture
if id "$username" &>/dev/null ; then
dsimport "$pictureImport" /Local/Default M && echo "Successfully imported profile picture."
fi
else
echo "picture not found"
fi
Posted on 05-14-2021 09:45 AM
Is there a way to set icons for everyone?
Posted on 05-27-2021 04:46 AM
Also looking for a solution setting the icon for regular users to a "User Picture" and installed admins should use a special "Admin Picture" – so it's easy to see if all neccessary accounts on the machines … would be great if someone's having a idea how to solve … (we also are looking for a solution having special desktop backgrounds for the admins – so we can see on the first view who is logged in …)
Posted on 05-27-2021 07:22 AM
Put this at the beginning of the script I'd posted earlier and remove the username= and userPicture= lines.
## get currently logged in user
username=$(stat -f%Su /dev/console)
## check admin status
isAdmin=$(/usr/sbin/dseditgroup -o checkmember -m "${username}" admin | cut -d" " -f1)
if [ "$isAdmin" = "yes" ];then
userPicture="/Users/Shared/adminImage.jpg"
else
userPicture="/Users/Shared/standardImage.jpg"
fi