Created
March 13, 2018 19:04
-
-
Save talkingmoose/abd85bdedce0624dbf13c472a7a9681c to your computer and use it in GitHub Desktop.
Jamf Extension Attribute reports whether computer name matches serial number.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
computerName=$( scutil --get ComputerName ) | |
serialNumber=$( system_profiler SPHardwareDataType | grep 'Serial Number' | awk -F: '{ print $2 }' | xargs ) | |
if [ "$computerName" = "$serialNumber" ]; then | |
echo "<result>Computer Name is correct</result>" | |
else | |
echo "<result>Computer Name is incorrect</result>" | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment