Posted on 09-22-2017 10:30 AM
I don't see this as part of the install.
Thanks.
Posted on 09-22-2017 10:52 AM
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.
Posted on 09-22-2017 11:39 AM
Lots of scripts here on Jamf Nation. Are you needing help with something specific?
Posted on 09-22-2017 01:07 PM
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.
Posted on 09-22-2017 01:24 PM
@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.
Posted on 09-22-2017 02:35 PM
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'
Posted on 09-22-2017 07:35 PM
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?
Posted on 09-23-2017 10:06 AM
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