Posted on 09-27-2022 08:21 PM
I want a simple script to add to self service which will give me a dialog box with some selection/drop-down and some text boxes which will all tie together at the end to create the name and then recon to push to jamf.
Drop-down will have 4 choices each and everything will be selected manually.
Final name will be
Example: NA.John.Doe.M1Pro14
Posted on 09-28-2022 09:52 AM
Use cocoaDialog or osascript to capture names if you're not assigning them in the Jamf Pro server first - see here for a good start - but why give users the option to incorrectly enter hardware info? Just grab it programmatically:
serial=$(ioreg -c IOPlatformExpertDevice -d 2 | awk -F\" '/IOPlatformSerialNumber/{print $(NF-1)}')
model=$(/usr/sbin/sysctl -n hw.model)
hwmodel=$(ioreg -l | awk '/product-name/ { split($0, line, "\""); printf("%s\n", line[4]); }')
platform=$(/usr/bin/arch)
processor=$(/usr/sbin/sysctl -n machdep.cpu.brand_string)