Skip to main content
Question

Create script in automator to change recovery key


Forum|alt.badge.img+3

Hey ,

I've been using JAMF NOW for a several months now at my company for Macbooks. I'm trying to write a script to change the recovery and get the recovery key in Jamf. I'm trying to write the script like a way that the user only has to login in with their administrator account account and that the script will run in terminal. These are the possibilities I've tried in "Automator"

osascript -e "do shell script "mkdir -p /var/db/sudo/$USER; touch /var/db/sudo/$USER" with administrator privileges" &&
sudo -S fdesetup changerecovery -personal

osascript -e 'tell app "Terminal" do script "sudo fdesetup changerecovery -personal"
end tell'

pw="$(osascript -e 'Tell application "System Events" to display dialog "Password:" default answer "" with hidden answer' -e 'text returned of result' 2>/dev/null)" && / echo "$pw" | sudo -S fdesetup changerecovery -personal

I've tried several scripts but they aren't working they send me to the terminal but they don't run the script or I get an error message that the login is not correct

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings