Add a user to the admin group via command line
A colleague asked how he could promote a user to an admin via the command line. Here’s how I do it:
niutil -appendprop . /groups/admin users gneagle
replacing gneagle with the user’s shortname. You can add both local and network users to the local admin group.
You should probably do a
niutil -readprop . /groups/admin users
to make sure the user isn’t already in the admin group.
Removing a user from the group:
niutil -destroyval . /groups/admin users gneagle
The tool we’re using is
niutil, which presumably stands for NetInfo Utility.
man niutil for more information.
Note: niutil is on its way out, and is scehduled to disappear in Leopard (OS X 10.5). So we’ll have to do something using