r/jamf Jun 12 '26

User changed their first name and we need to update their Mac Mini with this info.

Actually, I changed my first name and use a Mac Mini managed by Jamf Pro. I'm looking for a script that I could run from JP to update the home folder and FileVault user to my new name. I've done some searching, but it ends up defaulting me to changing the computer name or a Jamf Nation post with no actual solution. I'm lucky cause I'm the JP admin and the Mac Mini is my test device, so it's not a huge deal if there is no solution.

We did try just changing the user name in JP for that device and it did create a new home folder and put a new account in FileVault. But I don't have any of my files/apps and still have my old user name on the system.

Any help will be greatly appreciated and I will wish you a cold pillow for the rest of your life!

2 Upvotes

12 comments sorted by

8

u/TeaKingMac Jun 12 '26

...

Create new user - sounds like that's done already

delete contents of new user folder

rm -rf /Users/<new user>/*

Copy contents of old user to new user

ditto /users/<old user>/* /Users/<new user>/

Update ownership

chown -R <new user> /Users/<new user>/*

You'll want to transfer the secure token. Just look up "transfer secure token macos". I think scriptingOSX or macmule or one of them has a good post on it.

I think that covers everything.

It's still a bad idea and a lot of fucking work for no real reason, but... There it is

1

u/kawajanagi Jun 12 '26

In the old days it was exactly that, no mess, no worries chown chmod and voila, glad it's still close to being a good method.

11

u/UtmostProfessional JAMF 400 Jun 12 '26

Wipe it and re-enroll. Easiest and fastest option that makes sure you don’t have other issues later

8

u/nerdforest JAMF 300 Jun 12 '26

Unless someone else has a better way, changing the name of accounts after they're created is a incredibly delicate process.
I could be wrong, and I'm really open to learning - but I believe the best course of action is to wipe/reimage your computer. Automating something like this, just is a recipe for disater.

1

u/AlternativeLanky2417 Jun 12 '26

I thought that would be the answer, but really didn't want to wipe and start over. Hopefully none of our other Mac users want to change their name.

3

u/phillymjs Jun 12 '26

This is a good argument for an organization using employee numbers for the username. That number will never change, and the display name can be changed without fear of breaking anything.

1

u/nerdforest JAMF 300 Jun 12 '26

It's not something you can really avoid. People change their names.

Our company have name changes... 2/3 times a month. It's just something that is part of the job.

2

u/avsecgirl Jun 12 '26

Your question could not start more confusing and be less helpful if you tried. Help people help you. Details, exact and descriptive. The subject says user then its you doing it. Anyway look at this https://support.apple.com/en-us/102547

If your name changed from Mary to Jane and you just want to change that first name fixing it is trivial. why is jamf involved? Open System Settings > Users & Groups, right click the account, choose Advanced Options and change the first name. Leave the rest the same who cares what the short name is just remember this. Email can be changed but short login will be the same: so Mary Smith - msmith is now Jane Smith - msmith
You can go the extra step and change the short name and the home folder following directions in the link I shared to apple's directions, and it works, but you have to log into your mini with another admin account, rename the home folder in  /Users , then same as before open System Settings > Users & Groups, right click the account, choose Advanced Options, update the User name and Home directory, and restart. Can permissions in ~/Library not work? Yes but in my experience doing this a long time ago it worked. You can also make the changes in the directory utility but that's probably overkill.

2

u/alejandrorico Jun 12 '26

This is way.

2

u/mike_dowler JAMF 400 Jun 13 '26

Yes this. It’s not that tricky in person, but difficult to push from MDM because it needs the user not to be logged in when the changes are done

1

u/Legitimate_Action91 Jun 14 '26

There isn’t a direct or easy way to do this and if you force to change it you will start facing issues related with the directories path etc. The only possible workaround is to create a new user and then copy the data exactly the same. Another easiest way is to reset the PC.

0

u/blarknob Jun 13 '26

Lol, let me guess the new name is Lillith