Setting Login Hint for FileVault Screen

New Contributor II

Hello everyone!

I have the following code snippet in a script from Enterprise Connect when a user successfully changes their password (synced to AD + Local user password).

What I was expecting to happen is the login hint to be set for the FileVault pre-login screen as well as the user login screen. If I change the password through Security & Privacy the hint gets updated, so I know it's possible to have a hint displayed on pre-login, but I'm trying to get it done after the fact because of how Enterprise Connect works.

dialogText="Enter the password hint for your system:"
hint="$(osascript -e 'Tell application "System Events" to display dialog "'"$dialogText"'" default answer "" with icon {"/Library/Custom/Icons/logo.png"}' -e 'text returned of result' 2>/dev/null)"

dscl . -delete /Users/`whoami` hint
dscl . -append /Users/`whoami` hint "$hint"

#just verifying that it worked while testing
dscl . -read /Users/`whoami` hint

The FileVault hint screen seems to stay on whatever hint was set last (through Security & Privacy). But if get beyond the FileVault screen to the user selection, then the password hint it is the new one.

Does anyone know where the FileVault hint is stored or how I can programmatically change it?