Posted on 10-29-2020 11:22 AM
Every time I change an erroneous computer name on Jamf through "Search Inventory" the name eventually reverts back to "David's MacBook Pro" or something.
Any ideas why this might be happening?
Solved! Go to Solution.
Posted on 10-29-2020 12:53 PM
@dlprentice Changing the computer record name in Jamf Pro will not actually change the Mac's local hostname. So when the Mac does a recon the next time, the computer record name in Jamf Pro will be updated to the current local Mac hostname.
What you probably want to do is rename the Mac in Jamf Pro, then set up a policy and use the Maintenance payload, and the "Reset Computer Names" option, then scope the computer to that policy and set it for once-per, at check-in.
Posted on 10-29-2020 12:53 PM
@dlprentice Changing the computer record name in Jamf Pro will not actually change the Mac's local hostname. So when the Mac does a recon the next time, the computer record name in Jamf Pro will be updated to the current local Mac hostname.
What you probably want to do is rename the Mac in Jamf Pro, then set up a policy and use the Maintenance payload, and the "Reset Computer Names" option, then scope the computer to that policy and set it for once-per, at check-in.
Posted on 10-05-2023 04:49 AM
I am doing this and still have device names revert back.
Posted on 10-30-2020 09:57 AM
We had a similar issue but ryan.ball is correct, it won't actually change the name of the computer. We had to run a script to rename all our hosts appropriately. Or you can do manual renaming with scutil commands:
scutil --set ComputerName
Posted on 10-30-2020 09:01 PM
sudo jamf help setComputerName
Usage: jamf setComputerName [-target <target volume>] [-name <name>]
[-useMACAddress] [-useSerialNumber] [-suffix <suffix>]
[-prefix <prefix>] [-fromFile <path to file>]
-target The target drive to set the name on
-name The new name for the computer
-useMACAddress Generate the name using the MAC Address
-useSerialNumber Generate the name using the Serial Number
-prefix Add this prefix to the MAC Address or Serial Number
-suffix Add this suffix to the MAC Address or Serial Number
-fromFile The path to a CSV file containing the computer's MAC Address or Serial Number followed by the desired name
sudo jamf setComputerName -useSerialNumber -prefix MAC
sudo jamf recon (to update the machine name on Jamf Pro once set locally)
This command is smart enough to set it for:
Hostname
LocalHostname
Netbios Name
Posted on 10-16-2023 01:15 PM
@snowfox thanks for the Info but when I run that at the end of the name it adds "(null) " how would remove it?
Posted on 11-04-2020 05:04 AM
Thank you all!
Posted on 11-10-2020 09:08 AM
I'm a little late to this party, but I had the same issue when we switched over last year and needed an easier way to rename computers as purchased. Manually naming them wasn't really an option as we have over 1,000 computers.
I found the below and am currently using it. Once computer enrolls with jamf and checks in there is a script that runs and pulls a Google sheet with the serial and desired name. The computer renames itself, restarts, and the change sticks on both sides.
https://www.macblog.org/post/automatically-renaming-computers-from-a-google-sheet-with-jamf-pro/
Posted on 11-23-2021 02:25 AM
hi, i'm new to jamf, but what I want to achieve right now is to change the computer name in jamf now+ and push to devices. Is this possible in jamf now+.
Posted on 06-04-2024 03:50 AM
I basically do this but i use a .csv uploaded within jamf, until recently this worked great. All of a sudden it stopped working and I have NO idea why. Here is my script, of course i removed username and password.
#!/bin/bash
## Enter the API Username, API Password and JSS URL here
apiuser=
apipass=
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