Posted on 04-23-2021 07:29 PM
Aside from making an EA then making smart groups based on that value, is it possible with the native GUI to do the following:
that way I can compare the values that JSS already has - serial in hardware, computer name in general.
Otherwise the crappy way would be run the policy to rename computer name once a week or something but have no group reporting :(
Thanks!
Posted on 04-23-2021 09:08 PM
@beeboo There's no way to create a Smart Group like you ask without involving an EA. Depending on your naming policy, and whether or not you use AD binding, the easiest thing to do would probably be have a script that runs daily/weekly that checks to see if the current computer name meets your org's standards and rename if not.
Posted on 04-24-2021 07:08 AM
You can use this EA (thanks @mm2270
#!/bin/sh
computer_name=$(scutil --get ComputerName)
serial_number=$(ioreg -rd1 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformSerialNumber/{print $4}')
if [ "$computer_name" == "$serial_number" ]; then
result="Yes"
else
result="No"
fi
echo "<result>$result</result>"