120

Open Directory supports up to 200,000 records. For a local NetInfo directory, make sure the file contains no more than 10,000 records.

2Log in as the administrator of the directory domain you want to import accounts into.

3Use the dsimport tool to import users and groups. For example, to import a file generated by Workgroup Manager named ”sample” and export it into the LDAPv3 directory located at 192.168.2.2, use the following command:

$ dsimport -g sample /LDAPv3/192.168.2.2 -O -u diradmin

Replace diradmin with the short name of the directory administrator. When two records match, the import file will overwrite the matching record.

4To create home folders for imported users, use createhomedir . See “Creating a User’s Home Folder” on page 109.

Creating a Character-Delimited User Import File

You can create a character-delimited file by using Workgroup Manager or dsimport to export accounts in the LDAP directory of an Open Directory master or a NetInfo domain into a file. You can also create a character-delimited file by hand, using a script, or by using a database or spreadsheet application.

The first record in the file, the record description, describes the format of each account record in the file. There are three options for the record description:

ÂWrite a full record description

ÂUse the shorthand StandardUserRecord

ÂUse the shorthand StandardGroupRecord

The other records in the file describe user or group accounts, encoded in the format described by the record description. Any line of a character-delimited file that begins with # is ignored during importing.

Writing a Record Description

The record description specifies the fields in each record in the character-delimited file, specifies the delimiting characters, and specifies the escape character that precedes special characters in a record.

Encode the record description using the following elements in the order specified, separating them with a space:

ÂEnd-of-record indicator (in hex notation)

ÂEscape character (in hex notation)

ÂField separator (in hex notation)

ÂValue separator (in hex notation)

ÂType of accounts in the file (dsRecTypeStandard:Users or

dsRecTypeStandard:Groups)

ÂNumber of attributes in each account record

Chapter 8 Working with Users and Groups

Page 120
Image 120
Apple Mac OS X Server manual Creating a Character-Delimited User Import File, Writing a Record Description