This example describes a mass project that is used to import a number of user accounts from a csv-file into Novell eDirectory. The script of the project is deliberately limited to the essential actions that deal with user account creation in Novell eDirectory with UMRA using LDAP. A similar script can be used with UMRA Form and Automation projects.
Example project The example project can be found at the following location relative to the UMRA Console program directory:
.\Example Projects\LDAP\Novell\AddUserMass\Novell_eDir_CreateUserAccountMass.upj
The example project contains embedded input data representing user accounts. For each line of the input data, the script does the following:
1. Setup a secure LDAP session with the LDAP Server;
2. Setup the LDAP modification data to add the user account;
3. Add the account.
The following section describes the project in detail.
Figure 16: Example project to import bulk user accounts in Novell eDirectory using UMRA and secure LDAP (SSL).
Setting up LDAP session The LDAP session is setup with the LDAP Server, in this case the computer that runs Novell eDirectory: pacific.tools4ever.local2.
Figure 17: Setup LDAP session script action
The LDAP server is specified using a DNS name or TCP/IP address. The LDAP port only needs to be specified when it does not equal the default port (LDAP, no SSL: 389, LDAP with SSL: 636). The SSL encryption flag is set to enable secure communication. When SSL is used,
certificates need to be installed on both the LDAP Server and Client side.
The User name depends on the directory service implementation. In this case, an organization O=Servers contains the administrator account admin that is used to access the data. The password is not actually shown.
When the action is successfully executed, the session is initialized. The session object is stored in a variable with default name:
%LdapSession%. This session is variable is used in subsequent actions of the script.
Note: When the action is executed, the password specified is send over the line. When SSL is enabled, the password is automatically encrypted since all communication with the LDAP Server is encrypted. When SSL is not used, the password is send as clear text.
Loading LDAP
modification data With the next action, the data structure used to add the user account is prepared. This data structure contains a number of attributes, each with one or more values. The exact attributes used to add a user account vary for each directory service implementation that supports LDAP.
Figure 18: Load LDAP modification data script action.
The common name is defined in the next action (Add directory service object (LDAP)). The objectClass and sn attribute are initialized in the modification data structure. Besides these attribute, also the
givenName, homePhone and userPassword attributes are setup.
Figure 19: Properties of action to setup LDAP modification data.
Depending on the schema definition, an attributes can have a single or multiple values. Values can be specified using variables. In the example shown, the attributes sn, givenName and homePhone are specified using variables %SurName%, %GivenName% and
%HomePhone% and linked to the input csv file. The objectClass attribute gets the same 3 values for each user account: top, person and inetOrgPerson as defined by the eDirectory schema.
To setup an individual attribute, double click one of the attributes.
Figure 20: Dialog used to specify the modification type and values of a single attribute.
Finally the user account is created with script action Add directory service object (LDAP). During this action, the UMRA software actually communicates with the LDAP Server.
Add directory service object
Figure 21: Add directory service object (LDAP) script action.
The action has 3 attributes:
1. LDAP session: The session is specified by a variable and must have been initialized with a previously executed action Setup LDAP session.
2. New object name: The common name of the new LDAP object.
The name must be specified as a distinguished name and depends on the directory service structure. In this example, the account is created in organizational unit UserAccounts, part of the organization Tools4ever of the eDirectory tree. The first part
11:58:45 11/18/2005 Variable 3: %HomePhone%=460-608-205 11:58:45 11/18/2005 Variable 4: %NowDay%=18
11:58:45 11/18/2005 Variable 5: %NowMonth%=11 11:58:45 11/18/2005 Variable 6: %NowYear%=2005 11:58:45 11/18/2005 Variable 7: %NowHour%=11 11:58:45 11/18/2005 Variable 8: %NowMinute%=58 11:58:45 11/18/2005 Variable 9: %NowSecond%=45 11:58:45 11/18/2005 Setting up LDAP sessions with host 'pacific.tools4ever.local2'. Using SSL encryption: 'Yes'.
11:58:45 11/18/2005 User name: 'CN=admin,O=Servers'.
11:58:45 11/18/2005 Secure LDAP session established with host
'pacific.tools4ever.local2' (Protocol: 'SSL 3.0 client-side', encryption:
'RC4 stream', cipher strength: 128 bits, hash: 'MD5', 128 bits, key exchange:
'RSA', 2048 bits).
11:58:45 11/18/2005 Authenticating user 'CN=admin,O=Servers'...
11:58:45 11/18/2005 User 'CN=admin,O=Servers' successfully authenticated on LDAP server host 'pacific.tools4ever.local2'.
11:58:45 11/18/2005 LDAP session information stored in variable '%LdapSession%'.
11:58:45 11/18/2005 Storing LDAP modification data in variable '%LdapData%'.
11:58:45 11/18/2005 LDAP modification data:
11:58:45 11/18/2005 ************** Modification data element: 0 *************
11:58:45 11/18/2005 Operation: 'add', type of data: 'text' 11:58:45 11/18/2005 Attribute: 'objectClass'
11:58:45 11/18/2005 Value 0: 'top' 11:58:45 11/18/2005 Value 1: 'person' 11:58:45 11/18/2005 Value 2: 'inetOrgPerson'
11:58:45 11/18/2005 ************** Modification data element: 1 *************
11:58:45 11/18/2005 Operation: 'add', type of data: 'text' 11:58:45 11/18/2005 Attribute: 'sn'
11:58:45 11/18/2005 Value 0: 'Eris'
11:58:45 11/18/2005 ************** Modification data element: 2 *************
11:58:45 11/18/2005 Operation: 'add', type of data: 'text' 11:58:45 11/18/2005 Attribute: 'givenName'
11:58:45 11/18/2005 Value 0: 'Circe'
11:58:45 11/18/2005 ************** Modification data element: 3 *************
11:58:45 11/18/2005 Operation: 'add', type of data: 'text' 11:58:45 11/18/2005 Attribute: 'homePhone'
11:58:45 11/18/2005 Value 0: '460-608-205'
11:58:45 11/18/2005 ************** Modification data element: 4 *************
11:58:45 11/18/2005 Operation: 'add', type of data: 'text' 11:58:45 11/18/2005 Attribute: 'userPassword'
11:58:45 11/18/2005 Value 0: 'secret'
11:58:45 11/18/2005 Adding LDAP directory service object 'cn=Circe Eris, ou=UserAccounts,o=Tools4ever' with LDAP modification data obtained from variable '%LdapData%'.
11:58:45 11/18/2005 ***** Ready processing entry 241...
11:58:45 11/18/2005 Total number of script action execution errors: 0.
End of session
The log file shows the following information:
1. The LDAP session is setup using SSL with Novell eDirectory host pacific.tools4ever.local2.
2. The account used to authenticate and access the LDAP Server is cn=admin, o=Servers. The password specified is send encrypted over the line since SSL is enabled.
3. Once the connection is successfully initialized, the SSL encryption parameters are shown. The user is authenticated and the session structure is stored in variable %LdapSession%.
4. The LDAP modification data structure is setup and stored.
5. The item is added to the directory service, e.g. the user account is created.