Hello folks,
any chance to run Jamf CLI commands like "sudo jamf policy" or "sudo jamf launchSelfService" from a bash script?
Thanks a lot|
Hello folks,
any chance to run Jamf CLI commands like "sudo jamf policy" or "sudo jamf launchSelfService" from a bash script?
Thanks a lot|
@BusterCasey Run your script via sudo (e.g. sudo ./myscript.sh) and in the script don't prefix the jamf binary cals with a sudo (i.e. use 'jamf policy' instead of 'sudo jamf policy')
@BusterCasey Run your script via sudo (e.g. sudo ./myscript.sh) and in the script don't prefix the jamf binary cals with a sudo (i.e. use 'jamf policy' instead of 'sudo jamf policy')
Thank you, It works. I realized that the issue is that i launch the bash script from a Applescript:
do shell script "/path/to/yourscript.sh" with administrator privileges
Every bash commands inside the sh works great (sudo or not) except the jamf cals to the jamf binary. Can't understand why 😥
Try using the fullpath for jamf
/usr/local/bin/jamf
I have found some scripts fail until I use the full path to the command.
I Set a policy up in self service to be able to run what I call a check in.
#!/bin/bash
sudo jamf policy; sudo jamf recon
Even gave it an icon. That way I can scope something out and tell a user to go to self service and check in so we don't have to wait..
User the full path: /usr/local/bin/jamf
I have to do this with commands in Apple Remote Desktop
User the full path: /usr/local/bin/jamf
I have to do this with commands in Apple Remote Desktop
The easy way to find the full path for any command is to use the which command in terminal,
so
which jamf
Returns
/usr/local/bin/jamf
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.