diff --git a/Jamf Pro/Scripts/reissue_FileVaultPRK.sh b/Jamf Pro/Scripts/reissue_FileVaultPRK.sh new file mode 100644 index 0000000..581743d --- /dev/null +++ b/Jamf Pro/Scripts/reissue_FileVaultPRK.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +################################################################################################### +# Script Name: reissue_FileVaultPRK.sh +# By: Zack Thompson / Created: 12/19/2017 +# Version: 1.0 / Updated: 12/19/2017 / By: ZT +# +# Description: This script creates a new FileVault Personal Recovery Key by passing a valid Unlock Key via JSS Parameter to the Script. +# - A valid Unlock Key can be any of: a user account password or current Personal Recovery Key +# +################################################################################################### + +/usr/bin/logger -s "***** FileVault Key Reissue process: START *****" + +################################################## +# Define Variables + +cmdFileVault="/usr/bin/fdesetup" +# Check if machine is FileVault enabled + fvStatus=$($cmdFileVault isactive) + +################################################## +# Now that we have our work setup... + +if [[ $fvStatus == "true" ]]; then + /usr/bin/logger -s "Machine is FileVault Encrypted." + + $cmdFileVault changerecovery -personal -inputplist < + + + +Password +$4 + + +XML 1> /dev/null + +else + /usr/bin/logger -s "Machine is not FileVault Encrypted." +fi + +/usr/bin/logger -s "***** FileVault Key Reissue process: COMPLETE *****" + +exit 0