4 Replies Latest reply: Oct 20, 2012 1:06 AM by jquilty
jquilty Level 1 Level 1 (0 points)

I have a list of about 200 users that I have to setup Local Network Accounts for on a new Mac Mini Server.  I see in the notes on the latest Server Application update it shows: "using the Server application to create a large number of users or groups."  I also see under the Manage menu there is an option for "Import Accounts from File...".  The problem is, I can not find any instructions on how to go about setting up the list of users for import.  Looking at the Server Application Help there is actually a link for "Create a file to import users or groups" but it currently goes nowhere.  I'm hoping someone knows how to go about creating a CSV or Tab Deliminated file that I can use to setup User Names and such otherwise I'll just have to bite the bullet and create them one at a time.  Thanks everyone.


Mac mini, OS X Server
  • 1. Re: Import a List of Users to Server Application
    Kevin Neal Level 2 Level 2 (480 points)

    Might not be that straight forward, I've just exported my list of users using WGM and the contents follows this pattern

     

     

    xxxxxxxx:0A2F0320-12AE-4A23-8E10-56273AC36E4D:::1043:20::::xxxxxxxx:/Network/Ser vers/yyyyyy.co.uk/Volumes/UsersHD/xxxxxxxx:5000000000:/bin/bash::<home_dir><url> afp\://yyyyyyy.co.uk/UsersHD</url><path>xxxxxxx</path></home_dir>:::::<?xml version="1.0" encoding="UTF-8"?>\

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http\://www.apple.com/DTDs/PropertyList-1.0.dtd">\

    <plist version="1.0">\

    <dict>\

              <key>simultaneous_login_enabled</key>\

              <true/>\

    </dict>\

    </plist>\

     

     

     

    Where xxxxx is the username and yyyy is the domain name, I wouldn't fancy hand writing that for 200 users!!!

     

    Hope someone knows another way, did you have these users set up before on an older server, if so you can export it to a file

  • 2. Re: Import a List of Users to Server Application
    jquilty Level 1 Level 1 (0 points)

    Thanks Kevin, If that's the format I'm sure It'd be faster to add them by hand, lol.  This is a brand new server so no old list.  I basicly have an Excel file with the users full name's and I'll be creating accounts and assigning groups and permissions.  Thanks for the input.

  • 3. Re: Import a List of Users to Server Application
    Kevin Neal Level 2 Level 2 (480 points)

    Actually try using Workgroup Manager instead of server.app, you should be able to import tab delimited plain text files with that

  • 4. Re: Import a List of Users to Server Application
    jquilty Level 1 Level 1 (0 points)

    So, finally figured this out with some help from the 10.6 Server Admin PDF.  Available here:

    http://manuals.info.apple.com/en_US/UserMgmt_v10.6.pdf

     

    The way to create a TXT file to import via either the Server Application or Workgroup Manager is on page 278.  It is not just a matter of creating a spreadsheet (at least I've not found an easy way to export one in the format it needs to be), you're better off creating a TXT file.  I'll include the one I'm using as an example.

     

    Start with the headers that tell Server.app or Workgroup manager what fields you'll be using.  This starts with a definition of used characters in Hex format.  I'm using the standard ones from the 10.6 manual:

     

    0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Users 8 dsAttrTypeStandard:RecordName dsAttrTypeStandard:AuthMethod dsAttrTypeStandard:Password dsAttrTypeStandard:UniqueID dsAttrTypeStandard:PrimaryGroupID dsAttrTypeStandard:RealName dsAttrTypeStandard:UserShell dsAttrTypeStandard:NFSHomeDirectory dsAttrTypeStandard:HomeDirectory

     

    If your curious about the Hex entries for the characters used, I figured them out by using Workgroup Manager to attempt to import just a standard CSV file.  When you go to import is asks you to define the delimitation characters and gives you their Hex equivalents.

     

    In this order, I'll be including:  Short Name, Defining the Authentication Method, Password, UID, GID, Full Name, Shell, Home Directory (two different entries to work correctly).  The second one is kind of annoying to type out but it seems to be the only way to get the Server Application to setup the AFP home directory correctly.  If you just want Local Only home directories, then I'm assuming you can leave out the last two entries.

     

    Records are entered one per line, Return specifies a new one.  The attributes are separated by ":".  Here is the test account I imported successfully:

     

    test:dsAuthMethodStandard\:dsAuthClearText:12345:1051:1025:Test:/bin/bash:/Netwo rk/Servers/server.myserver.com/Users/test:<home_dir><url>afp\://server.myserver. com/Users</url><path>test</path></home_dir>

     

    I entered a few test records and imported them successfully via both the Server Application and the Workgroup Manger.  A couple of important things:

    1. When Importing via the Server Application, it asks you for an Admin Name and Password.  Use your Directory Admin user and Password, in my case the user was diradmin.  Trying my local admin account resulted in an error
    2. If your trying to import these user into the OD the attribute "AuthMethod" is extremely important.  I tried using just the standard Password attribute and constantly got an error.
    3. I highly recommend reading the section in the 10.6 Server Admin manual, it's how I figured this out and still applies in 10.8.2.

     

    Hopefully this helps others besides myself.  It's not quite as straight forward as I was hoping for, but I still think it will be faster than entering 160 users by hand.

     

    Here's the combined TXT file I've imported.  I saved it in Plain Text UTF-8 format:

     

    0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Users 8 dsAttrTypeStandard:RecordName dsAttrTypeStandard:AuthMethod dsAttrTypeStandard:Password dsAttrTypeStandard:UniqueID dsAttrTypeStandard:PrimaryGroupID dsAttrTypeStandard:RealName dsAttrTypeStandard:UserShell dsAttrTypeStandard:NFSHomeDirectory dsAttrTypeStandard:HomeDirectory

    test:dsAuthMethodStandard\:dsAuthClearText:12345:1051:1025:Test:/bin/bash:/Netwo rk/Servers/server.myserver.com/Users/test:<home_dir><url>afp\://server.myserver. com/Users</url><path>test</path></home_dir>

    userone:dsAuthMethodStandard\dsAuthClearText:12345:1052:1025:User One:/bin/bash:/Network/Servers/server.myserver.com/Users/userone:<home_dir><url >afp\://server.myserver.com/Users</url><path>userone</path></home_dir>