Which Scripting Language Will Help To Administrating Mac OS with Jamf Pro ??

sjha967
New Contributor II

Last couple of times, i was get into Python & Bash programming. But, someone say R is good becuase there is lots of library available to use without coding. But on Python everything needs to code.

Also wondering the programming or language should have future which will help or compatible with Jamf activity etc.

9 REPLIES 9

dsavageED
Contributor III

Most of the scripts we use are based on python or bash, with the odd fallback to applescript...

If your curious see - https://github.com/UoE-macOS/jss

bpavlov
Honored Contributor

Bash or Python if you're starting off.

boberito
Valued Contributor

Just like @dsavageED said, bash and python with the occasional AppleScript.

I've personally played with php to make a simple web page thing to update some elements in the jss.

m_donovan
Contributor III

Bash has been our primary scripting language for a while now. With the future implementation of the universal api (and possible departure from XML) the need for python's json tools may require a shift to python. I am attempting to learn more about python now just in case.

blackholemac
Valued Contributor III

Bash and AppleScript are the easiest to start out with. I tend to like Bash of those two as it gets more to the point and less error prone, but AppleScript has it's place...particularly if you need an enduser GUI involved.

If you are in a spot to learn Python, I'd recommend as it can parse JSON well and is more powerful than simple bash scripting.

wesleya
Contributor

I would strongly recommend Bash. Python is powerful for sure, but a lot of the functional changes you commonly need to make are (arguably) best made with Bash scripts. There are a lot of binaries native to macOS that can handle a number of tasks. A couple good resources I can think of for scripts are:

  • MacAdmins Slack
  • Jamf Nation
  • https://github.com/rtrouton
  • https://github.com/jamfprofessionalservices
  • Google

Really just start looking around for the things you want to do (Wi-Fi migration, automating software updates, making GUI changes, etc.). Then start making scripts and testing them out.

Look
Valued Contributor III

Bash all the way as a starting point for me, the direct similarities to how things behaviour in Terminal makes it very very easy to learn and test.
Applescript is useful for a number of UI things, but even then you usually just want to be calling snippets of it from Bash.

connor
New Contributor III

+1 Bash.
Python and AppleScript are great for some of the features too. We mainly use bash for any extension attributes we make too, they are just smaller and neater, plus any changes for scripts used in configurations or policies we find are better changed on the fly in bash.
A final plus for me is that its super super easy to test, if it works in a mac terminal then it works in a script. Usually at least.

rhooper
Contributor III

Bash.

there is a book available that was recommended by a JAMF CSR.
Find it here at amazon: https://www.amazon.com/gp/product/1596822015/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1