Where are the examples scripts for Casper/Jamf Pro?

Vernaf
New Contributor II

I don't see this as part of the install.

Thanks.

7 REPLIES 7

mm2270
Legendary Contributor III

I'm not sure what you mean by example scripts. There are template Extension Attributes in the JSS (which are mostly all script based) and there are scripts located here on JamfNation related to products or other functions. But I don't know of example scripts that would be used in say, a policy that come as part of the install. Unless that's something very new.

jskidmore
New Contributor III

Lots of scripts here on Jamf Nation. Are you needing help with something specific?

Vernaf
New Contributor II

Thanks. I read there was a bashexample.sh test script that came with Casper that would be good to check out. But my Real problem is that I found a script online (Remove2011) and I put it in JSS but I'm getting an Exit Code 1. Am I suppose to edit this script? Or I am Suppose to enter some parameters in the policy? Not sure how to do either.

mm2270
Legendary Contributor III

@Vernaf I think you'd need to post the script here or a link to it for us to look at to help you. It's virtually impossible for anyone to tell you why a script is exiting code 1, or guide you on what to do, without actually looking at the script.

koalatee
Contributor II

The problem with this script is that it's intended to run in user context. Jamf Pro runs scripts as root, so you need to add the local $USER context. I've edited it for my context here: https://github.com/koalatee/scripts/blob/master/jamf/MS_OfficialRemoveOffice2011.sh

I've added it to a package then run this command (in the same policy) after the pkg has been installed:
'sh /$path_to_script/MS_OfficialRemoveOffice2011.sh --force'

Vernaf
New Contributor II

So it installs as a package, it doesn't actually do anything until it's triggered by the command which is set to run after the install. Correct? Does it matter the location of the install or does the command finds it on it's own?

jared_f
Valued Contributor

Scripts our very helpful in completing task that profiles cannot accomplish. I prefer using scripts to mount our network drives because I find it is more reliable than profiles. Here is an example of a drive mount script I use.

#!/bin/bash
# Script to mount network drives.

theuser=$(/usr/bin/who | awk '/console/{ print $1 }')
/usr/bin/osascript > /dev/null << EOT

        tell application "Finder" 
        activate
        mount volume "INSERT PATH TO VOLUME HERE "
        end tell


EOT

echo $theuser
killall cfprefsd
defaults write com.apple.finder ShowMountedServersOnDesktop true
killall -HUP Finder