Good Morning
So we have been using a .csv inventory preload with a script since we set up jamf a number of years ago, all of a sudden it is no longer renaming the computers properly. It is used to rename the machine to the asset tag, the asset tag shows up correctly in the jamf inventory if i do a search but it just will not rename.
When the policy runs it says its completed, so i don't even have an error to research. I have no idea what has changed. I have checked the account username/password, tried deleting data from the preload and re-uploading a new sheet. What am i missing here
Here is the script we are using.
#!/bin/bash
## Enter the API Username, API Password and JSS URL here
apiuser="account"
apipass="password"
jssURL="https://quinnipiac.jamfcloud.com"
## Get the Mac's UUID string
UUID=$(ioreg -rd1 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformUUID/{print $4}')
## Pull the Asset Tag by accessing the computer records "general" subsection
Asset_Tag=$(curl -H "Accept: text/xml" -sku "${apiuser}:${apipass}" "${jssURL}/JSSResource/computers/udid/${UUID}/subset/general" | xmllint --format - 2>/dev/null | grep asset | sed -e 's/<[^>]*>//g')
echo "$Asset_Tag"
# Set Computer Name
sudo scutil --set HostName ${Asset_Tag}
sudo scutil --set LocalHostName ${Asset_Tag}
sudo scutil --set ComputerName ${Asset_Tag}
# Update Inventory
sudo jamf recon