Using a DEP prestage enrollment, I'm trying to get the following script to kick off right after the user is at the desktop. If I scope a policy to trigger at "Enrollment Complete", the policy is being triggered for user "_mbsetupuser" and the JAMF Helper dialogue box opens up in the setup assistant rather than at the desktop. If I use "Login" as the trigger, the JAMF dialogue box opens at the desktop, but clicking "Log Out" doesn't cause the logout to occur.
EDIT: I should add that I've scoped the policy to Self Service and manually ran it. It works as expected that way.
I am a novice when it comes to scripting. The base script I'm using is something I found on JAMF Nation.
!/bin/bash
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
windowType="hud"
description="To begin FileVault disk encryption of your Mac, you will need to log out and log back in. Please save any work and click 'Log Out'. You will automatically be logged out in 5 minutes."
button1="Log Out"
button2="Cancel"
icon="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
title="Configure FileVault Encryption"
alignDescription="justified"
alignHeading="justified"
defaultButton="1"
timeout="300"
JAMF Helper window as it appears for targeted computers
userChoice=$("$jamfHelper" -windowType "$windowType" -lockHUD -title "$title" -timeout "$timeout" -defaultButton "$defaultButton" -icon "$icon" -description "$description" -alignDescription "$alignDescription" -alignHeading "$alignHeading" -button1 "$button1")
If user selects "Log Out"
if [ "$userChoice" == "0" ]; then
sudo kill -9 pgrep loginwindow
exit 0
fi