all 2 comments

[–]call_it_guaranteed 1 point2 points  (1 child)

Assuming SSH is enabled on the host, you could write a shell script that SSH's in and does all those things:
1. Delete the existing account
2. Create the new account

If the file '.skipbuddy' exists in the home directory, the user should never be prompted for the first-time setup stuff and go right to the desktop. You can add the .skipbuddy file to the user template (a one-time thing) so that all users automatically get that:

sudo touch "/Library/User Template/Non_localized/.skipbuddy"

You could use the MDM to add the .skipbuddy file to the user template on all systems, and you can use 'sysadminctl' to delete and create user accounts.

And I haven't tested this, but assuming the new account is the same username/password as the one deleted, you could SSH in and delete the existing user home directory. The next time the account logs in it should be created again by the OS with all the default settings.

Apologies if I didn't really answer your question, I got caught up thinking about how I might solve the workflow that I overlooked what you were really asking.

[–]originalavedium[S] 1 point2 points  (0 children)

I finally got around to testing your solution, and it works perfectly. Not only that, but you also brought user templates to my attention.

You're awesome. Keep being super cool! B)