Posted on 01-06-2022 04:37 PM
Is there a Terminal command I can use to manually run, from Terminal, a Jamf script I've created?
Solved! Go to Solution.
Posted on 01-13-2022 10:36 AM
+1 for throwing your script into a policy with a custom trigger and just running that via
sudo jamf policy -event TRIGGERNAME
There used to be a
sudo jamf runscript
command, but it was clunky and hard to use. Looks like they deprecated it at some point and I didn't even notice.
there's a decent thread on it here with some info on it, but it was clunky and hard to use.
% jamf help runscript
There is an error in your syntax.
Error: runscript does not have any help.
Type "jamf help" for more information.
01-06-2022 07:59 PM - edited 01-06-2022 08:00 PM
@Satchmo No, there is not a mechanism to directly run a script in your JSS from the command line using the jamf binary. What you could do however is create a policy containing a Script payload with your script and scoped to all machines but with the only trigger being a custom event. That policy can be triggered from the command line using this syntax: sudo jamf policy -event TriggerNameHere
Posted on 01-07-2022 02:43 PM
For just 1 or 2 machines, I create the script, use Jamf Remote, select the machine and the script, run and done. If for whatever reason you can't, then @sdagley is right, use the custom trigger.
Posted on 01-07-2022 08:46 PM
@YanW I intentionally ignored Jamf Remote as an option because it's essentially useless for remote Macs connected via VPN, and Jamf has stated it will no longer be distributed in a future version of Jamf Pro (estimated removal date: May-July 2022)
Posted on 01-12-2022 01:12 PM
the custom trigger method is your friend. Jamf Remote, RIP. Good riddance. It was buggy as hell and more often than not would error on login...it would be useless for days and often require a bounce. However, there were times when JAMF Remote was awesome for some tasks. It was cool to be able to run policies and commands/scripts on multiple machines in real time. Too bad JAMF never bothered fixing it.
Posted on 01-13-2022 10:36 AM
+1 for throwing your script into a policy with a custom trigger and just running that via
sudo jamf policy -event TRIGGERNAME
There used to be a
sudo jamf runscript
command, but it was clunky and hard to use. Looks like they deprecated it at some point and I didn't even notice.
there's a decent thread on it here with some info on it, but it was clunky and hard to use.
% jamf help runscript
There is an error in your syntax.
Error: runscript does not have any help.
Type "jamf help" for more information.
Posted on 01-13-2022 11:00 AM
@easyedc The runscript verb was for running a script already on the Mac, not from the JSS. It was deprecated because it ran the script with all of the PPPC allowances in place for the jamf binary, and that was a Very Bad Thing™.