Import users and groups from a file

You can import users and groups from character-delimited text files, which is an easy way to quickly set up accounts.

You can use the dsexport command-line tool to create character-delimited text files of accounts on your network server. For information about how to use dsexport, enter man dsexport in Terminal.

Passwords aren’t included in the export files generated by dsexport, but you can edit the file to included them. Otherwise, you’ll need to assign passwords to users after importing.

  1. If your server isn’t set up to host network accounts, set it up to do so.

    For information, see Provide Open Directory service.

  2. In the Server app, choose Manage > Import Accounts from File.

  3. Select the file to import, then click Import.

You can also use the dsimport command to import users from a file. Users imported from a file don’t have access to services until you grant them access. For information about granting users access to services, see Define service access by users.

See also
Host network accounts
Reset a user’s password
Change a user’s account settings
Create a user account
Create a group
Grant access to users from another network account server