Posted on 01-05-2015 04:30 AM
I'm pretty new to Casper and my scripting skills are not up to speed yet so I'd like to do all of this in Casper if at all possible.
I have a requirement to:
Can all this be done step by step in the JSS, and if so can I be sure everything gets run in order? Or is it better to have an independent, all-in-one script? If so, how would you do this?
I have a little experience with Casper Imaging. Any guidance is gratefully appreciated!
Posted on 01-05-2015 05:15 AM
These are my normal methods:
1. I set the computer name using Casper Imaging during deployment
Hope this helps.
Posted on 01-05-2015 06:34 AM
I had just recently used Scutil to rename some laptops that were not in Casper, but this could be used if you happen to have them deployed already but need to change names.
I ended up writing this script to read the NetBIOSName, as Deploy Studio names them and pushes their name to our AD, and then using it to rename the HostName, LocalHostName and ComputerName.
Here's the script:
#!/bin/sh
#Retrieves Name from NetBiosName
defaults=$(defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName)
#Sets Name retrieved from NetBiosName
scutil --set HostName $defaults
scutil --set ComputerName $defaults
scutil --set LocalHostName $defaults
#Prints Scutil Names in terminal for report of new name
scutil --get HostName
scutil --get ComputerName
scutil --get LocalHostName
I might add that scutil seems to report wrongly for the new name from time to time. For me ComputerName would report the previous name, but when I would manually check scutil it would report correctly that time.
Posted on 01-05-2015 08:21 AM
@ianmb, I've written up my imaging workflow: https://macmule.com/2014/12/21/my-casper-imaging-workflow/
We do some similar steps to you, here's a breakdown using the above too: