OS X Mountain Lion has a lot of scripts used for enabling services, setting states, changing hostnames and the like. Once upon a time there was a script for OS X Server called server setup. It was a beautiful but too simplistic kind of script. Today, much of that logic has been moved out into more granular scripts, kept in /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup, used by the server to perform all kinds of tasks. These scripts are, like a lot of other things in Mountain Lion Server. Some of these include the configuration of amavisd, docecot and alerts. These scripts can also be used for migrating services and data, such as /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/MigrationExtras/30-ipfwmigrator. Sometimes the scripts…
-
-
Creating Accounts in OS X Server with serversetup
I usually create users by dropping a couple of files or by using a dscl script. But in Mac OS X Server it’s even easier than that. You can use the serversetup command, by default located in /System/Library/ServerSetup to do so with the -createUserWithID option. Following the -createUserWithID option, use the long name, then the short name, then the password and finally the UID of the intended user (that’s position 1 = long name, position 2= short name, position 3 = password and position 4 = UID). Therefore, if /System/Library/ServerSetup is your working directory then the following command can be used to create a user with a full name of Charles,…
-
CLI: Get and Set Mac OS X Server Serial
You can use the serversetup tool in /System/Library/ServerSetup/ to set the serial number for a Mac OS X Server. Provided the ServerSetup directory is your working directory you can then use the serversetup tool to configure the serial number ./serversetup -setServerSerialNumber “XSVR-105-000-N-xxx-xxx-xxx-xxx-xxx-xxx-x|Charles Edge|318” Once the serial number has been set you can then get the serial number using the following command no matter the working directory: /System/Library/ServerSetup/ -getServerSerialNumber