Here's my challenge...
I need to set the ComputerName, LocalHostName, and HostName values using the value of the username that was input into https://jss.domainname.com:8443/enroll at the time the QuickAdd.pkg is run...
We all know about the following commands:
sudo scutil --set ComputerName <ComputerName>
sudo scutil --set LocalHostName <LocalHostName>
sudo scutil --set HostName <HostName>
So no need to discuss those.
Here is WHY I need this...
- We are setting a naming convention standard...
- Our Macs are bound to Active Directory...
- We need to truncate the ComputerName to 15 Characters to adhere to pre-Windows 2000 (NetBIOS) requirements...
Here is what I envision the process should look like...
- User self-enrolls via https://jss.domainname.com:8443/enroll
- User downloads and runs QuickAdd.pkg
- QuickAdd.pkg runs a script
- The script DOES NOT rely on the currently logged in username
- The script somehow gets the username the user typed in into the enrollment window
- The script massages the username to fit neatly into the 15-character or less format (if necessary)
- The script sets the ComputerName, LocalHostName, and HostName values
- QuickAdd.pkg continues and bind to AD using the 15-character or less ComputerName value
- The QuickAdd.pkg finishes with success
- I sit back and have a beer!
Awesome sauce. Right?!
So - I've been pouring over the QuickAdd.pkg installer log to see if there's a smoking gun to grep the user credentials as used to enroll into the JSS. Not seeing those. I see the local username details.
Anyone have an idea how I can get the username from the enrollment process passed to my script?
Thoughts?
Thanks!