The UImport Utility

     

The UImport utility is one of the most powerful ”and underused ”utilities included with NetWare 5. (Alas, it is not included with NetWare 6.) The history of this 16-bit command-line utility dates back to NetWare 4, but its roots can be traced all the way back to the MAKEUSER.EXE utility introduced just before NetWare 2.15 started shipping.

NOTE

On NetWare 5.x servers, UImport is installed only if you are running NDS 7. If you upgraded the server or initially installed the server with NDS 8, the utility is removed. However, you can reinstate it and use it against all versions of NDS and eDirectory.


TIP

If you have access to a NetWare 5.x operating system CD, you can copy the following files to the directory of your choice, and you will have a working copy of the UImport utility:

 SCHEMA.XLT TEXTUTIL.HEP TEXTUTIL.MSG UIMPORT.EXE UIMPORT.MSG 

Because UImport is a DOS-based application, you need to ensure that you have a search path to the necessary Unicode files.


The idea behind UImport is very simple: Provide a batch-mode process to enable mass user creation and modification. In pre-NetWare 4 environments, the Makeuser utility provided this functionality; because the bindery definition for a user was fixed, it was a very simple utility to use. UImport is a somewhat more complex utility in comparison to Makeuser because it has to handle the different attribute syntaxes that NDS/eDirectory uses.

UImport uses two data files: a control file and a data file. The file format for these files is easy to understand ”they both can be created in any text editor. The control file contains two sections: an Import Control section and a Fields section. Each of these sections is prefaced by the section name . Table 12.2 provides examples for the Import Control section of the file.

Table 12.2. UImport Import Control Field Definitions

FIELD

DEFINITION

SAMPLE

Create Home Directory

A Boolean value (Y/N) that tells UImport whether to create a home directory in the file system for the user being created.

CREATE HOME DIRECTORY=N

Delete Mailbox Dirs

A Boolean value used to determine whether the mail directory (used for bindery services) for the user should be deleted.

DELETE MAILBOX DIRS=Y

Delete Property

A field that is used to specify a special value for UImport to search for in the data file that means the field should be deleted.

DELETE PROPERTY=#DEL

Home Directory Path

The path for the parent directory where the home directory is to be created.

HOME DIRECTORY PATH=USERS

Home Directory Volume

The distinguished name (DN) of the Volume object the home directory will be created on.

HOME DIRECTORY=NETWARE65_USERS.East.XYZCorp

Import Mode

A field that can have one of the following values:

C (create)

U (update)

B (both create and update)

R (remove).

IMPORT MODE=U

Maximum Directory Retries

The number of attempts to assign the user as a trustee to the home directory. This is necessary because of synchronization delays if the user is created on a server that the home directory is not on.

MAXIMUM DIRECTORY RETRIES=5

Name Context

The default context to use for the UImport operation. If not specified, the current context of the work-station is used.

NAME CONTEXT=.East.XYZCorp

Quote

A character that represents a quotation mark. This allows values to have embedded spaces, and it can be changed in order to enable quotation characters to be embedded in property values. The default is the double-quote character.

QUOTE="

Replace Value

With multivalued fields, an option that enables you to overwrite the existing value (when set to Y ) or add a new value to the attribute (when set to N ).

REPLACE VALUE=Y

Separator

A character that is used to delimit fields within a record. The default is a comma.

Separator=,

User Template

A Boolean value used to designate whether UImport uses the User Template user in the context being used for creation as a template for new user objects.

USER TEMPLATE=Y


The following are some important notes about some of the fields that you need to keep in mind when working with UImport:

  • The Delete Property field is used to specify a special value to be included in the data file. If you set this value to #DEL and you want to delete the Given Name property for a group of users, you put #DEL in the field of the data file that represents the Given Name attribute.

  • The Delete Property field also has a few fields it does not affect: the Volume Restrictions field, the Password field, and the Home Directory field. You delete the Volume Restrictions field by specifying that field and putting a space restriction of -1 in it. To delete the Password field, you specify it in the fields section and put a blank value in the data file. For the Home Directory field, you must manually delete the field by using NetWare Administrator, ConsoleOne, or some other DS management tools.

  • The Replace Value field can be very dangerous if it is not used properly. For example, if you are adding groups to a large number of users and you specify REPLACE VALUE=Y in the control file, you need to delete all previous group memberships and explicitly add the memberships specified in the data file.

  • The User Template field used by UImport is a User object and not a Template object that is used by NetWare Administrator or ConsoleOne. If you use this type of template, the following list of fields is copied from the User Template object: Account Balance, Account Has Expiration Date, Allow Unlimited Credit, Allow User to Change Password, City, Days Between Forced Changes, Default Server, Department, Description, Fax Number, Foreign Email Address, Foreign Email Alias, Full Name, Generational Qualifier, Given Name, Grace Logins Allowed, Group Membership, Home Directory, Language, Location, Login Allowed Time, Login Script, Low Balance Limit, Mailbox Location, Mailing Label Information, Maximum Connections, Minimum Password Length, Network Address Restriction, Postal (ZIP) Code, Postal Office Box, Profile, Remaining Grace Logins, Require a Password, Require Unique Passwords, Security Equal To, See Also, State Or Province, Street Address, Telephone, and Title.

The absolute minimum number of fields needed in the Import Control section depends on the operation being performed. Table 12.3 shows the fields needed for each operation. The Name field refers to the CN attribute of the object and is what UImport uses to designate this attribute.

Table 12.3. inimum Fields Required for the Various Import Modes

IMPORT MODE

MINIMUM FIELDS REQUIRED

C (create)

Name, Surname

U (update)

Name, another field to modify

B (both create and update)

Name, Surname

R (remove)

Name


The Update mode requires only the Name field. Specifying only the Name field would not be useful, however; you also need to specify another field to update. The B mode (both create and update) requires both the Name and Surname fields because users are created if they do not exist, and the Surname field is a mandatory attribute for the User class.

When the Import Control section is completed, you need to define the Fields section. This section starts with the line Fields and then lists the DS attribute names the data file contains, one per line.

TIP

If you don't know the name of a particular DS attribute you want to use, you can use DSBrowse or NDS iMonitor to get the attribute name. Besides the Name field, the other fields use the NDS /eDirectory attribute name as defined in the schema. For a list of all Import Control section field names and supported Fields section names, you use UIMPORT /? ALL .


Determining the syntax of some of the fields can be tricky. For example, if you look at the definition for the Volume Space Restrictions attribute, you will find that there are multiple parts to the attribute. To specify the different parts of the value, you separate them with colons. For example, if you wanted to specify that the user is limited to 100MB (102,400KB) of disk space on server Rigel's DATA: volume, you would specify .RIGEL_DATA.EAST.XYZCorp:102400 in the field used in your data file to represent the desired space restriction.

A sample control file might look like this:

 IMPORT CONTROL      Import Mode=U      User Template=N      Name Context=.East.XYZCorp      Delete Property=#Del FIELDS      Name      Given Name      Surname      Full Name      Telephone Number 

This control file, named UPDATE.CTL (you can call the file anything you want), specifies the following options:

  • Update existing users; do not create new ones.

  • Do not apply the User Template object's values for these users.

  • The context the users exist in is East.XYZCorp .

  • Fields filled in with #DEL should be deleted.

  • Values in the data field are delimited by a comma (which is the default separator).

  • The data file contains the fields Name, Given Name, Surname, Full Name, and Telephone Number.

The data file must then be constructed . To do this, you can use a database program that outputs comma-delimited files (sometimes referred to as comma-separated variable [CSV] text files) or you can create the file by using your favorite text editor.

The fields need to appear in the order specified and need to all be present. The file can contain as many records as you need to update, although with larger files it may be desirable to break the operation into smaller pieces.

For the discussion here, the data file is named UPDATE.DAT and contains the following records:

 "JHenderson","Jim","Henderson","Jim Henderson","801-555-1234" "PKuo","Peter","Kuo","Peter Kuo","907-555-5678" "TestUser","Test","User","Temporary Test User","#DEL" "JimH","Jim","Henderson","Jim Henderson (Admin)","801-555-1234" "PeterK","Peter","Kuo","Peter Kuo (Admin)","907-555-5678" 

When you are ready to invoke Uimport, use the following command:

 UIMPORT UPDATE.CTL UPDATE.DAT /C 

The /C parameter tells UImport not to pause on every screen of information.

TIP

You can use UImport to manipulate users in multiple contexts. The easiest way to do this is to specify the full DN of the user with a leading period in the Name field (for example, .JimH.Admin.XYZCorp ).


Given that it is a legacy utility, UImport has a number of limitations, including the following:

  • It does not support schema extensions (such as GroupWise) made to User objects, including auxiliary classes.

  • The password it sets is only the DS password. Other password types, such as simple password, GroupWise password, or Universal Password, are not supported.

  • Home directory names are limited to the 8.3 DOS format.

TIP

You can work around some of UImport's limitations by using the Import Conversion Export ( ICE ) utility instead (see the section "The LDAP ICE Utility," later in this chapter). However, an excellent replacement is JRBImprt, which is part of the JRB utilities (see the "JRB Utilities" section, later in this chapter).


The next section looks at the second-most- underutilized tool included with NetWare: NList. Chapter 10, "Programming for eDirectory," offers some advanced techniques for building a data file by using output from NList.



Novell's Guide to Troubleshooting eDirectory
Novells Guide to Troubleshooting eDirectory
ISBN: 0789731460
EAN: 2147483647
Year: 2003
Pages: 173

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net