
- #Jamf run script install
- #Jamf run script full
- #Jamf run script software
- #Jamf run script code
- #Jamf run script mac
If Jamf changed the way to call a custom event it also would mean only changing the primary script which just makes things slightly easier, as opposed to using the “Execute Command” feature located under Files and Processes in a Jamf Policy. So when setting up a machine, if I don’t see the notice that it’s starting the process I can click it from Self Service. If the network connection is interrupted during the enrollment, it may never see the trigger. I also use this to kickstart our DEP Provisioning workflow in Self Service because the enrollmentComplete trigger from Jamf can be unreliable. This means I only need to edit one policy if something changes in the installer, package name, or choices XML modifications. I can have multiple policies that refer back to the primary one.

#Jamf run script install
I can also create another policy to automatically install on newly DEP enrolled machines during their provisioning workflow.
#Jamf run script software
They refer back to a policy that actually installs the software that is only triggered by the custom event. You can find all of the scripts, the keynote and other resources Briegel shared during this presentation at his website for JNUC 2020.I use this script to create Self Service policies that are scoped specifically to the required OS or department.
#Jamf run script full
Upload it to your MDM and give certain processes pre-approval.įor the full script description and details, view the scripting Jamf JNUC 2020 video. The best tool for this, he said, is the PPPC Utility profile creator or iAmazing profile tool. Sometimes creating a PPPC profile is necessary.īriegel walked users through building an approval profile.
#Jamf run script mac
AppleScript usually talks wtih other processes that are owned by the user, and Mac has protections against root-run processes.ĭisplay Dialog/Notification scripts also need to be run as the user. For safety, run all osascripts as the user. These scripts generally need to run as the user. Briegel offered several scripts to address this issue. Many management tasks require root, but some require that it be run as user. This effects the behavior and what it can access. But if you launch the same script from Jamf or an installation script, it will be running as root. Scripts also inherit the user who is running the shell in terminal. There's a slight risk you'll override built-ins (/bin/echo)Ī better way of creating an environment you can be certain about is to create that environment at the beginning of your script.

#Jamf run script code
One solution around this uncertainty is to always use the full path to commands.ĭownsides: there's more code to type and to read, and there's more to remember. The /usr/local/bin folder is not protected it's meant to be a place for you to add functionality to the terminal, and because of that it might be unreliable for management. Universal PATH folders you can rely on: /bin /sbin /usr/bin /usr/sbin The path environment variable will not be the same.ĭepending on the environment, the default path will be different.

Data may be missing, which may lead to your script failling.ĭo not assume these even exist: $USER, $HOME, $SHELL, $PWD When you run the same script as a Jamf policy or installation script, the shell will have a different environment. Your scripts runs from this and inherits a certain environment. When you run in Terminal, all of this is built from configuration in your terminal application, but also from the shell config files you may have created or gotten from third-party. Each terminal gets its own instance and shell options variables, aliases and functions. You write a script, it works in testing, and it stops working. For example, if configuring Jamf Connect Login with the notify screen during an Automated Device Enrollment workflow, you can add the notify screen script file path to your login window configuration profile. How the shell environment affects scripts You can configure Jamf Connect Login to run a script after the authentication process. Armin Briegel, a Mac admin, consultant and author, walked JNUC 2020 participants through best practices when scripting for Jamf Pro.
