Posted on 11-15-2017 12:56 PM
Greetings. Would anyone have a working script to rename a customer's home folder? In our environment Macs are named with the actual user name. (boo-hiss..I know...) And as you can imagine, people's name change ever so often. It's a total manual process and I'm looking to automate it as much as possible. I have changing the computer/host name scripted and working, but the home folder is a different animal.
I've read of using dscl . create
but not sure if that's needed.
Is it possible to simply rename to the new name and boom, done, as long as the customer is not logged that is? Thanks compadres..
Posted on 11-15-2017 04:31 PM
You would need to remove the user record first using
sudo /usr/bin/dscl . -delete /Users/$youruserhere
rename the home folder to their current name
Make sure the permissions are correct
login as the user
Posted on 11-15-2017 06:37 PM
Thanks @justinssmith I'll test that tomorrow!
Posted on 01-21-2020 08:07 AM
Hey @steve.summers !
New here! was wondering if you ever found an easier way around this. If so, it'll be great if you can share here. Thanks!