Determining Mac OS Version and Remote Naming on a Mulit-OS Mac.

New Contributor III

I know this isn't specifically for JAMF, but I'm hoping someone here might have some idea on what to do here. I'm still trying to get my group to try Casper, but it's stuck in limbo at the moment, so I'm trying to accomplish the processes in DeployStudio. Sadly, DeployStudio's forums aren't taking new members at the moment (apparently). You folks have been super helpful for related issues in the past.

I'm in the midst of exploring using DeployStudio for a series of Macs that are running multiple OSs on different partitions. Active Directory requires a separate entry for each OS, so let's say I have a Mac running 10.10, 10.9 and 10.8. The goal is to create a system that can fully automate the imaging and binding of multi-boot Macs.

However, automatic binding with Active Directory runs on the MAC Address or the Serial Number (I'm doing Serial Number in this case, but it doesn't matter). So no matter what OS I'm in, if I use the default automatic AD Binding Script, it will always default to the "standard" name which I've set to be in a form similar to "FS-OSX10-####."

DeployStudio has successfully bound the HD running 10.10 and I used a small script to create a text file to identify the computer's number.


MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print 0$2}')
MAC_NUMBER=$(scutil --get ComputerName | awk -F '-' '{print $3}')
echo $MAC_NUMBER > /Admin Files/NameScript/MACNUMBER.txt

ECHO $TOTALNAME > /Admin Files/NameScript/totalname.txt

I then have another script designed for all OSs besides 10.10 that pulls that MACNUMBER.txt file down to compile the correct name for the OS.


MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print 0$2}')

NumberFile="/Volumes/Mac OS 10.10/Admin Files/NameScript/MACNUMBER.txt"
MAC_NUMBER_10=$(cat "$NumberFile")


scutil --set ComputerName "$TOTALNAME"

The script works perfectly within the OS, because that's where it's pulling the OS from. My problem is I'm in a 10.10 NetBoot.

Does anyone have a suggestion on how to pull the OS version from a partition and then use the scutil command to set the computer name (or hostname) on a specific partition?


Valued Contributor

You can pull it from: /System/Library/CoreServices/SystemVersion.plist on each partition.

Valued Contributor

Do it during a post boot script, then you can configure anything easily. In Deploystudio you have the option to set a script for 'Postponed execution, launched on first boot'. Use the script to set time, computer name, bind, etc.