How to force depnotify to kick in right after enrollment?

Contributor II

So there is 2 scenarios:

1. When enrolling a mac manually through browser and installation of profile. Profiles are installed and also have set the "enrollment complete" trigger - and only this one trigger in first policy. But often it can take some time before the depnotify kick in. If I go to terminal and do a manual sudo jamf policy, it triggers that start of depnotify. So my question is how can it be made, so after enrollment the sudo jamf policy kick in right away - so depnotify is launched


In pre-stage enviroment we use Jamf connect that create account and also install depnotify. Seeing the desktop it again takes time before the sudo jamf policy is executed, so depnotify is not launched. Is there a way to trigger this so it launches right away when the desktop is seen first time. Somekind of launchdeamon maybe or what are other using ?


Valued Contributor

Something like the below might work for you. It is a script that writes another script to launch the enrollment policy or detect if DEP has run and delete itself and its calling plist. The plist is set to five minutes but can be changed to whatever works for you.




mkdir -p "$companyDir"

#write script, chown and chmod
touch "$scriptPath"
cat << '_EOF' > $scriptPath

    #Detect if DEP has begun, if so delete script
	if [ -f "$depLogPath" ]; then
    	rm "$scriptPath"
    	rm "$plistPath"
    	currentUser=$(ls -l /dev/console | cut -d " " -f 4)
    	currentUserHome=$(dscl . read /Users/$currentUser NFSHomeDirectory | awk '{print $2}') 
    	sudo -u $currentUser open "$jamfEnrollURL"
chmod +x "$scriptPath"
chown root:wheel "$scriptPath"

#write launch daemon chown 
touch "$plistPath"
cat << '_EOF' > $plistPath
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
chown root:wheel "$plistPath"
launchctl load -w "$plistPath"



Contributor II

Thanks. However, I think i somehow how to add that the launchdaemon is not kicked off before the desktop is visible for the user. As far I can read a way to do this if to check if the dock or finder process exist - but don´t have the skills to build this into your script

You can try taking a look at this tool as well by @Yohan :



Contributor II

If someone else has something usefull I would like to know

I think I launchdaemon that exectutes when finder/dock services is running is the way.