I am in the process of migrating my users from using a mix of OD and AD to a new AD domain. The users are all local users on their machines, and all laptop users have FileVault2 enabled. I would like to do this via Self Service so that the users can move themselves when they are ready.
I have cobbled together a script that works for the migration of the user: removes any current OD or AD bind, deletes the local account with dscl, binds to the new domain, changes ownership of the home folder to the new AD user. The problem I am having is with the FV2 enabled devices. Once you delete the local user account with dscl, the user is not part of FV2 anymore.
I've tried using cocoaDialog to get the user's password and then use fdesetup to add the user, but the user has to exist locally first. That means the user has to login to the machine once before I can add their user to the FV2 creds.
I've thought of a few ways to possibly handle this using a logout policy to set another logout policy, modifying the local user via dscl instead of deleting the user, and decrypting the drive before doing the move.
Has anyone had to do this before, and is there an easier way? With the amount of time I've been working on this I could have probably manually moved everyone, but I'm too stubborn to do that. :-)
Thanks!