Create admin user from command line

Discussion in 'macOS' started by hiddenpremise, Jul 26, 2008.

  1. hiddenpremise macrumors regular

    hiddenpremise

    Joined:
    Jul 25, 2008
    Location:
    Somewhere between my imagination and reality
    #1
    As part of a project I am working on I need to be able to create an administrative user from command line. I can create a standard user just fine using the dscl tool, but for some reason I can't get that user in the admin group.
    Code:
    sudo dscl localhost -append /Groups/admin GroupMembership [I]adminshortname[/I]
    As far as I know that should work, but I am getting
    Code:
    append: Invalid Path
    <dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)
    
    When I try to run it. I am on a 10.5.4 MBP 2.16 Core Duo x 2G x 320G

    Thanks in advance,
    Whit
     
  2. hiddenpremise thread starter macrumors regular

    hiddenpremise

    Joined:
    Jul 25, 2008
    Location:
    Somewhere between my imagination and reality
    #2
    I figured it out... path needed to be /Local/Default/Groups/admin
     

Share This Page