Name Changes

steve_summers
Contributor III

Greetings. I'm working on automating a very manual process and need to know if automating this one part is possible.
When a customer gets married and their name changes, there is a manual process involving the following:
-Unbind from AD
-Update computer name
-Create a new user account
-Move the data from the former home folder to the new
-Rebind the Mac
-Relaunch CrashPlan
I know all this can be automated and I have the computer renaming piece done, unbinding and re-binding complete and tested. What I am struggling with is adding to my script the ability to:
-Successfully create a new home folder (with the new name/proper permissions)
-Moving the customer's data from their old directory to the new

That's the piece I'm struggling with automating. If you have any nuggets of knowledge or tips/tricks, please send my way, it would be greatly appreciated.

4 REPLIES 4

bumbletech
Contributor III

We've been working with name changes a bit as teachers return from the summer. You don't need to create a new account, as per this guide from Apple, you can just change the username while the user is logged out, and update their home folder name as well. In theory it's easily scriptable, but it all needs to happen with the user logged out.

steve_summers
Contributor III

@jbourdon , do you have a link to the guide?

jssmith
New Contributor III

@steve.summers This one perhaps? HT201548

jssmith
New Contributor III

You should be able to use dscl to define the new home folder location.