Posted on 11-16-2020 10:10 AM
we are buying jamf and will have it stood up in about a month, but until then I need to deploy about five macs I cannot lay hands on and want to write a short script to add an admin account and deploy a few apps from a folder.
I have only done powershell, windows batch files, login scripts, etc.
Can someone help me with a good resource to pick up some know how on the scripting language for Macs? I am not a developer and havent done open source devscripting but is there a mac scripting language that would be a bit easier to pick up? Thanks in advance for any tips. I use macs all the time and have lots of experience on them, just never writing scripts for them.
Posted on 11-16-2020 10:49 AM
Hello,
While on Jamf Nation, click on the Resources tab. There is a training tab that takes you to the training catalog, which has a lot of great videos. You will find scripting videos available on that page also!
Hope this helps,
- Jonathan
Posted on 11-16-2020 12:23 PM
@ntpro13 The only "native" Mac-centric scripting language would be AppleScript....but I wouldn't recommend that.
You'll want to look at Shell/interpreter languages (bash/zsh). Bash was usually the defacto up until Catalina replaced it as default interpreter with zsh. Another popular one is Python, however, Apple deprecated the Python2 interpreter that ships default in macOS and plans to remove it in a future version, though it's still there in Big Sur as of today. However, a lot of Mac Admins are "shipping" (aka, installing) their own Python frameworks to their devices so that they can continue to run Python scripts -- highly recommend moving to Python3 at this point.
I still use PowerShell to write a lot of admin tools that we utilize, because I work on a team that also manages Windows devices.
I would recommend becoming familiar with Apple's "management style." What you can do on Windows, what Microsoft allows, is not always allowed on a Mac.
Posted on 11-16-2020 03:27 PM
This book helped me; “From Bash to Z Shell: Conquering the Command” Line by Oliver Kiddle.
In theory you can install the Powershell “shell” on macOS, however, it may be missing or changed functionality then your use to.
https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7.1
I mainly use bash scripts shifting to zshell scripts where I can (that’s the direction Apple moving to). You can think of zshell as enhanced version of bash.
Posted on 11-17-2020 07:56 AM
https://bookpedia.co/book/1483591353/moving-to-zsh
https://scriptingosx.com/about/