UIMPORT: An Oldie But a Goodie
Novell Cool Solutions: Feature
By Tom Gibson
Digg This -
Posted: 22 Nov 2002
New user accounts for over 1500 students need to be created quickly. The names of these students already exist in a school database. Can this information be used to speed up the user creation process and to avoid having to manually create these network accounts?
UIMPORT is a mass creation utility for user accounts. It's been around for quite a while but is still one the best (free) time-saving tools available for the Novell network administrator who must create dozens, or even hundreds, of user accounts in short order.
Where to find it:
UIMPORT is found in the SYS:\PUBLIC folder of many NetWare versions from 5.1 and earlier.
Where are the docs?
UIMPORT requires three things to function, the UIMPORT.EXE application, the data file, and the control file. Here's how we go about putting the pieces together.
First we create the data file. Usually, this is data that is exported from an existing database. UIMPORT prefers that this file be created in a comma-delimited ASCII format. If your database application cannot create a comma-delimited file, you can often import the data into another program such as Excel, then re-export it in the proper format.
What do we put into the data file? The two required items that are needed to create a user account are a username and a last name. In practice, you will likely wish to import other fields into the NDS/eDirectory record. To create our student accounts, we export the following information from the student database: last name, first name, middle name, and a school assigned ID number. Since we create student accounts in OU's named after graduation year, we filter our export query by grade level and create separate data files of the results. Before using this information with UIMPORT, we import the data into Excel and use its functions to quickly create the username, full name, and a password based on the unique school assigned ID number. See the section below for the Excel functions and formulas we use. Scan for and delete punctuation found in the data fields. Some punctuation causes problems during the user creation process. Also check for duplicate usernames in the list. Duplicate usernames in the same OU will cause a problem. Fix this by manually entering a unique username in the field for one of the duplicates. Finally, export the data contained in the Excel worksheet as values (not formulas) into a comma-delimited file.
While you can put many other user account attributes into the data file (see the documentation), we chose to create a user template for the values that will be common to all users within an OU. More on this when we discuss the control file.
Creating the Excel worksheet is easy once you have the following information:
- Column A holds the imported Last Name of the user
- Column B holds the imported First Name of the user
- Column C holds the imported Middle Name of the user
- Column D holds the imported Student ID of the user
- Cell E1 holds this formula to create the username:
- Cell F1 holds this formula to create the full name: =CONCATENATE(B1," ",A1)
- Cell G1 holds this formula to create the password: =CONCATENATE("SITE",D1)
Copy cells E1 through G1 to enough rows of columns E, F, and G to allow for calculation of the necessary values for each student record imported into the spreadsheet. Allow the copy command to change the references to cells A1, B1, C1, and D1 in the formulas to the relative number for each row.
Some additional notes on the Excel worksheet: Our naming convention for student usernames is the first six letters of the last name, plus the first initial and the middle initial. This convention usually allows Excel to automatically create most student usernames without duplicates within a single OU. The few duplicates that do occur are manually edited. Also, because UIMPORT has a limitation of eight characters when it creates users' home directories, our naming convention was created with this limitation in mind. Concatenate is the function that creates a single string value from more than one string or cell as source material. The LEFT(cell ID,number of characters) function returns the specified number of characters from a string value in the named cell starting at the left end of the string. Note that you must include a space in quotes in the formula to create the full name. Also take care in placing and counting the parentheses in these formulas. There has to be match between the number of open parenthesis and the number of close parenthesis. The exact placement of the parentheses and the commas are crucial.
Once the data file format is set, we create a complementary control file. The control file's purpose is to set parameters for the import process and to map the information contained in the data file to the appropriate location in the NDS/eDirectory user record. The order of the field definitions must match the order of the information in the data file. We normally use Notepad to create the control file, as it is quite easy to save the file in a text format. Again there are numerous options available for inclusion into a control file (check the docs) but here are the options that we use:
- Import control
(label for first section)
- Name context=.2005.SITE.ORGANIZATION
(change this to your context)
- User template=y
(must be named USER_TEMPLATE and located in Name context)
- Create home directory=y
- Home directory path=home/students/2005
(change this to your home directory path)
- Home directory volume=.SERVER_VOLUME.SITE.ORGANIZATION
(change this to your home directory volume)
- Replace value=y
(allows overwriting data if your user template contains duplicate information)
(label for second section)
- Last name
- Given name
(user first name)
(this tells UIMPORT to skip this field - in our data file, this is the middle name)
(optional, we use this field to store the school-supplied student ID number)
(the NDS/eDirectory username)
- Full Name
(user first name and last name)
(created with student ID number)
If you base your control file on the above example, do not include the comments within the parentheses or the parentheses themselves. Save the control file as control.txt or a similar name.
If you have not already done so, create a user template in the context specified in the Name context= parameter. Assign values to the user template that will be common for all users in that particular OU. The user template must be named USER_TEMPLATE or UIMPORT will not use it.
It is easiest to place all three of these files in the same directory so that full pathnames do not need to be specified. For speed, we suggest a directory on a local hard drive located on a workstation using the Novell Client that is logged in as a user with adequate rights to create users in the applicable context(s). Open a command line window, navigate to the directory that contains the three files and start the program with this command line syntax:
UIMPORT [name of control_file] [name of data_file] [/C]
By default, UIMPORT pauses after each screen of information is processed, which is helpful while debugging your control file. After all is working well, include the /C switch in the command line to allow UIMPORT to process the whole data file without pauses.
We will usually test our set up by creating a short data file of test user information, usually two or three dummy names entered into the Excel template and exported as a comma-delimited text file. Our test data file would appear like this:
Last,First,Middle,1234,LastFM,First Last,SITE1234 Doe,John,Smith,0123,DoeJS,John Doe,SITE0123 Browning,Sally,Jane,2345,BrowniSJ,Sally Browning,SITE2345
Most of the issues encountered in a UIMPORT job have already been mentioned above. Eliminating duplicate usernames (the Name parameter in the control file) and punctuation solves most of the issues we have found. Remember to be logged in as admin or an admin equivalent user to eliminate problems dealing with not having enough rights to create users or home directories. Make certain that the path leading up to the home directories exists prior to running UIMPORT. Spot-check a few of the user accounts to make certain that they were created correctly, have a corresponding home directory, and have the appropriate rights to that home directory. When encountering an error, UIMPORT can leave you with only part of the users in a data file created. We address this by troubleshooting the data file, removing the issue (usually one of the issues listed above), then resetting the process to start again.
We have fourteen different student OU's in our tree. For maximum efficiency we make this process a team effort. One technician exports the latest student data filtered by a specific grade level from one of the building databases. Another technician imports the data file into Excel, checks the data for problems, and then exports the values into the comma delimited data file. Our third technician edits the control file for the target data file and OU, then runs the UIMPORT application. By working in this manner, we have been able to create approximately 1500 student user accounts in about two hours.
Finally, we print out the Excel worksheets so the teachers in the buildings can assist students in determining their username and initial NDS/eDirectory password. We set the user accounts so the password needs to be changed within three grace logins. Although the student ID number is meant to remain private, invoking a password change helps to lessen the security risk if a student were to learn another student's ID number and figure out the initial password.
Final thoughts: The job is done for this year, but we are already looking to improve the process for next year. In looking at the documentation while preparing this article, we learned that we will likely want to add a line in the data file to set a space restriction on the server volume used by each student user.
Credit must be given to Kurtis Boughton and Rob Dickson for their contributions in developing our procedures and sharing their understanding of the UIMPORT process.
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com