Languages

Archived - Mac OS X Server: How to Use createhomedir Command to Create Home Directories

This document explains how to use the createhomedir command-line tool to create home directories.
This article has been archived and is no longer updated by Apple.
You can use the createhomedir command-line tool to create home directories for one or more users on the server on which you use the tool. Here are the parameters that createhomedir accepts. Parameters are delimited using angle brackets (<>) if they are required, and square brackets ([]) if they are optional:

createhomedir <-a or -l or -n directoryDomainName> [-u userName]

The flags have these effects:

-a

Creates home directories for users defined in all directory domains of the server's search path.

-l

Creates home directories for users defined in the local directory domain.

-n directoryDomainName 

Creates home directories for users defined in a specific directory domain in the server's search path.

-u userName 

Creates a home directory for a specific user defined in the domain(s) identified in the -a, -l, or -n parameter. The userName value must be a short name assigned to the user. If you omit the -a, -l, and -n parameters when you use the -u parameter, -a is assumed.

To use createhomedir to create home directories:
    1. Log in to the server on which you want the home directories to reside.
    2. Open the Terminal application.
    3. At the prompt, type :sudo -s
    4. Press Return.
    5. Enter your Admin user password when prompted, and press Return.
    6. You may then use the createhomedir command with the syntax described above. The createhomedir tool is located at: /usr/sbin

The following examples creates a home directory for a user with the short name "ichiro" who has an account in the shared directory domain "/NetInfo/root":

createhomedir -n /NetInfo/root -u ichiro

This command creates Home directories for all users defined in all directory domains of the server's search path if they do not already exist:

createhomedir -a

Note: Apple does not offer free telephone support for the use of this command line tool.
Last Modified: Feb 17, 2012
Print this page
  • Last Modified: Feb 17, 2012
  • Article: TA21050
  • Views:

    16855
  • Rating:
    • 71.0

    (9 Responses)

Additional Product Support Information