Account creation failing... sometimes.

woodgie_barc
New Contributor

So, part of our imaging solution (using PreStage Imaging and Casper Imaging) is to create a local account via a package (which I believe is a package created in Recon). However lately it appears to be semi failing.

The account IS created and can be logged into (i.e. it exists in /var/db/dslocal/Default/users).

But no home folder is created and on first login it wants to do the iCloud login thing which, when it is all running properly, it doesn’t do.

It is all very annoyingly intermittent too. So far only affecting 5 computers. I’m very certain nothing has changed and if it has, I can’t spot what it is.

Thoughts?

2 REPLIES 2

ryan_ball
Valued Contributor

You can throw this in the policy that installs the package or in the image to create the home folder for you to see if that helps (after creating the account of course):

#!/bin/bash

userName=""

/usr/sbin/createhomedir -c -u "$userName"

if [[ -d "/Users/$userName" ]]; then
     echo "Successfully created home folder for $userName"
     exit 0
else
     echo "Failed to create home folder for $userName"
     exit 1
fi

woodgie_barc
New Contributor

Thank you for that, a useful trick.

I'm just conscious that this has been working for about a year and a half and only now is having problems. I was wondering if anyone might have come across it before or could offer up any edge-case reason as to why it might be happening.