I was watching a Jamf webex and saw a policy to update asset tag via self service.
I really like the idea for support staff.
Has any one done something like thing?
Am going to guess its done via the API.
I was watching a Jamf webex and saw a policy to update asset tag via self service.
I really like the idea for support staff.
Has any one done something like thing?
Am going to guess its done via the API.
Best answer by RaulSantos
#!/bin/sh
########################################################################
# Created By: Raul Santos, ras2060@med.cornell.edu
# Creation Date: Oct 2nd 2014
# Last modified: Oct 2nd 2014
#
# Brief Description: Interactive prompt to change the computer Tag, used in Self Service
#
# Modification History
# Oct 2nd - New Script
########################################################################
# Set CocoaDialog Location
CD="/Applications/Utilities/cocoaDialog.app/Contents/MacOS/cocoaDialog"
# Dialog to enter the computer name and the create $ASSETTAG variable
rv=($($CD standard-inputbox --title "Asset Tag" --no-newline --informative-text "Enter the computer tag"))
ASSETTAG=${rv[1]}
# Set Hostname using variable created above
jamf recon -assetTag $ASSETTAG
# Dialog to confirm that the hostname was changed and what it was changed to.
tb=`$CD ok-msgbox --text "Computer Tag Added!"
--informative-text "The computer Tag has been added to $ASSETTAG"
--no-newline --float`
if [ "$tb" == "1" ]; then
echo "User said OK"
elif [ "$tb" == "2" ]; then
echo "Canceling"
exit
fiEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.