Add Services to Server Admin From the Command Line

In the Server Admin application, you need to enable any services before you can actually start them. In order to do so to a lot of servers at once, you want to automate that. Such automation can be done using the serveradmin command line options. The settings would be sent to info. To see all of the settings available there:

serveradmin settings info

Note that there’s a whole section for info:serviceConfig:

info:serviceConfig:roles:com.apple.SimpleServerSetup.ODPlugin:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.DirectoryServices:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.NetBoot:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.AddressBook:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.SWUpdate:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.NAT:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.Mail:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.Notification:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.VPN:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.DHCP:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.Calendar:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.AppleFile:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.Jabber:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.Radius:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.IPFirewall:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.Podcast:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.Windows:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.DNS:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.NFS:configured = yes
info:serviceConfig:services:com.apple.ServerAdmin.Xgrid:configured = no
info:serviceConfig:services:com.apple.ServerAdmin.Web:configured = yes

Toggling these will cause the corresponding service to appear in Server Admin. So to enable the VPN service to show in Server Admin:

serveradmin settings info:serviceConfig:services:com.apple.ServerAdmin.VPN:configured=yes

The server name is also set in info at configuration time and while the wizard changes the name in some places, it doesn’t change the name that appears on client systems for Profile Manager Management Profiles. info:ComputerName is the name that was given to the server when Server.app was installed, which doesn’t necessarily match the output of scutil –get ComputerName or HostName. Anyway, overall, there are a few interesting settings in here and when I’m looking for something I rarely think to look here first. A tip of the hat to Allan Sanderson (@allansan) for pointing this out on the ‘ole Twitter.

  • http://www.practiceofcode.com Jason Discount

    I got all excited thinking we could go back to using Server Admin for more detailed administration of Lion Server.app managed services, but alas, it does not appear that way.

    • http://www.krypted.com Charles

      Oh, sorry if the title was misleading. That wasn’t intentional… It’s more of the toggle on/off for mass server deployment stuff…

  • Howie Isaacks

    I enjoy reading your website, and the ifo you post on Lion Server has helped me a lot. I just can’t escape the fact that I’m very disappointed with Lion Server. To me, it seems too consumerized. Sometimes having things a little hard is a good thing. I keep looking for a definitive and complete book, or document on command line administration, but I haven’t found any.

    • http://www.krypted.com Charles

      Thanks for the kind words. I like to think of Lion Server as a bit of a work in progress. It’s sure to get a little better later this month and incrementally better over time. As for books on command line, there is a new O’Reilly pocket guide for terminal stuff in OS X. However, it’s not meant for servers per se (beyond the commands that are shared between servers and clients). I’m adding a bunch of command line management stuff to the Mountain Lion version of the Server book for O’Reilly, although if you’re pretty seasoned already I fear it might be a bit too glossy still… No one is going to make a definitive book on Server. They just don’t sell. It would have to be made by someone in the community and self published. Which, if I ever come up with about 10 minutes of free time I’ll write… ;)