So, I've asked this question before and received some excellent help from sharrison (https://www.jamf.com/jamf-nation/discussions/37206/set-new-computer-name-and-update-in-jamf-pro). Thanks again!
But I'm looking to refine it a bit, and I think my solution is through the Trigger.
My script:
!/bin/bash
username=$(/usr/bin/osascript<<END
tell application "System Events"
activate
set the answer to text returned of (display dialog "Please enter the computer name" default answer "" buttons {"Rename"} default button "Rename")
end tell
END)
echo $username
/usr/local/bin/jamf setcomputername -name $username
/usr/local/bin/jamf recon
I want it to run when I click a button in Self Service. Not just show up as an ongoing or recurring event, but always be available.
Right now, to make it available in Self Service makes the Rename box created in the script always pop up (see pic). I just want it to pop up when I click the "Change Name/Change Again" button is clicked.
Thoughts?