sudo "/Applications/Install macOS Sierra.app/Contents/Resources/startosinstall" --applicationpath "/Applications/Install macOS Sierra.app" --agreetolicense --nointeraction --volume /Volumes/Macintosh\ HDIn the above command, we’ve dropped “Install macOS Sierra.app” on a machine. While you’d guess that it would find the application path based on its own surname, we went ahead and supplied it as that seems to basically be a thing. Basically, –agreetolicense keeps us from having to run some expect scripts to accept a license agreement, –nointeraction suppresses as many of the screens as possible, and –volume allows us to install to any volume we’d like. This isn’t fully automated, but I have been able to layer in some more logic to quit apps before the script fires and then expect out other items from the script to automate a restart, watching for osinstallersetupd as a key. This is all a bit bulkier than just using something like createOSXinstallPkg but it’s important to mention that there are a number of system components that are allowed for in SIP that use osinstallersetupd and so this blessed mechanism is likely the future until you can trigger an OS upgrade (and update I suppose) using an MDM command.
krypted October 23rd, 2016
sudo systemsetup -listtimezonesTo set the time zone, pick one and use the -settimezone option in systemsetup:
sudo systemsetup -settimezone "America/Chicago"To check the current time, then run -gettime:
sudo systemsetup -gettimeThe -settime option can then be used to set the time, although it’s invariably better to set the time zone automatically with a network time protocol (NTP) server, using the -setnetworktimeserver option:
sudo systemsetup -setnetworktimeserver time.krypted.comYou would then need to turn using NTP servers on, using -setusingnetworktime option and setting the value there to on
sudo systemsetup -setusingnetworktime onNow let’s look at a different way to do this. Run the following, in OS X Server:
sudo serveradmin settings info:timeZone = "America/New_York"That shouldn’t work. Now ya’ know, OS X Server isn’t fully matured yet, so they’ll get around to it… But what does work is setting the NTP server and enabling NTP services. To enable NTP:
sudo serveradmin settings info:ntpTimeServe = yesTo set the NTP server:
info:ntpServerName = "time.krypted.com"Note: The NTP server must be accessible when set.
krypted August 18th, 2012