Hello All,
First off, I tried to find another post related to this type of thing and was not able to find on JAMF Nation so sorry if this is a duplicate post. I also scoured the web for this and seem to find things that are older or designed for much more complex needs.
I am trying to come up with a script that, at least to me, should be pretty simple to do. This will be deployed via Self Service for users to run, so not something executed from Terminal.
At bit of back story: I am trying to deploy FileVault in our environment and we have mobile/AD Joined accounts that will be used for enabling Encryption and generating recovery keys. My understanding is that this will require the local admin account (which does have a token verified by: sudo profiles status -type bootstraptoken) created in the Pre-Stage process on our machines to "pass" the Secure Token to these mobile accounts using the sysadminctl command. I would like to script the process out as much as possible and I am trying to find a good/simple solution to create a pop-up box prompt for the currently logged in user to enter their password and click OK.
This is what my script looks like so far. Any suggestions or tips is greatly appreciated!
#!/bin/bash
## Get the logged in user's name
LoggedinUser=$(/usr/bin/stat -f%Su /dev/console)
## Prompt for currently logged in users password
userPass=$ ??????????????????????????
## Enable the logged in user with secure token
sudo sysadminctl -adminUser <ourlocaladminaccount> -adminPassword -<ourlocaladminpassword> -secureTokenOn "$LoggedinUser" -password -$"userPass"