Skip to main content link. Accesskey S
  • HCL Logo
  • HCL Notes and Domino wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Designer agents > Is it possible to write an agent in Lotus Domino® to automate a user registration?
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Optimising NRPC Bandwidth Consumption for attachment

NRPC port not consuming complete bandwidth. Noticeably on slow-er connections like 3G

Is it possible to write an agent in Lotus Domino® to automate a user registration?

Is it possible to write an agent in Lotus Domino® to automate a user registration?

CNVD/CNCERT Advisory on Lotus Domino Internet Passwords

Lotus Domino provides customers with multiple means of authentication, each system being suitable to different levels of threat resistance and assurance requirements. Among these authentication techniques, Lotus Domino can authenticate a web client with a username and password. As in all ...

Missing parent documents when responses copied prior to parent

When a parent note is created in a Domino Database after one or more of its response note(s), the parent note is not visible until fixup is run against the database. when a parent note is retrieved by IBM CSLD after one of its response notes has been retrieved, the new parent note is not visible ...

Domino as a Certificate Authority

Setting up Domino Security Infrastructure specially with regards to the Certficate authority can be tricky. The following video is a complete step by step guide expalanation of all the CA options available with some key tips to resolve.
Community articleIs it possible to write an agent in Lotus Domino® to automate a user registration?
Added by IBM contributor~Bill Fezjipyskiakoi on May 5, 2011 | Version 1
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
Is it possible to write an agent in Lotus Domino® to automate a user registration?
Tags: User Registeration Class, Lotuscript Class to register users, Faisal Javed
The LotusScript NotesRegistration class provides a way to register new users. The RegisterNewUser method in the class, in addition to properties within the class, are used to accomplish the registration. The RegisterNewUser method can create an ID file for the new user, create a mail file, and add a Person Document to the Domino Directory.

The syntax of the RegisterNewUser method is as follows (see Supporting Information below for additional details):

notesRegistration.RegisterNewUser( lastname$, idfile$, mailserver$ [, firstname$ [, middle$ [, certpw$ [, location$ [, comment$ [, maildbpath$ [, fwddomain$ [, userpw$ [, usertype% [, altname [, altnamelang ]]]]]]]]]]] )

NOTE: The MailServer$ parameter must be passed in full canonical format (such as CN=ServerA/OU=West/O=Widgets). If you attempt to send mail to users who were registered without the MailServer in canonical format, the following error can occur: "No route found to server X/Org from server X/Org: check server and connection documents in Name and Address Book."

The following properties in the NotesRegistration class must be set prior to calling the RegisterNewUser method:

RegistrationServer
CertifierIDFile
IDType
MinPasswordLength

NOTE: Details on each property can be found in the Domino Designer Online Help.

The following sample LotusScript code demonstrates how to use the method. Replace the text in brackets <> with the information specific to your environment. It could potentially be adapted to loop through an array or text file for batch processing.

Dim Session As New NotesSession
Dim db As NotesDatabase
Dim NR As New NotesRegistration
Dim UseridFile As String
Dim Lname As String
Dim Fname As String
Dim MailServer As String
Dim Mlocation As String
Dim UserPassword As String
Dim UserMailPath As String
Dim CertPassword As String
Dim Comment As String
NR.StoreIDinAddressBook = True  
NR.CreateMailDB = True
NR.UpdateAddressBook = True
NR.IDType = ID_HIERARCHICAL

'PARAMETERS TO CODE:
NR.Expiration = Now() + (365 * 2)
NR.registrationServer="NotesServer"
NR.certifieridfile = ""
NR.OrgUnit = ""
MailServer = "" 'Must use full canonical version of name.  
FName = ""
MName = ""
LName = ""
UserPassword = ""
UserIDFile = "" 'May also use:  =Trim(Left(FName,1)+LName)
UserMailPath = "\" * useridfile
Mlocation = ""
Comment = "This entry added via agent on date x/y/z"  'As desired
CertPassword =    

If NR.RegisterNewUser(LName, UserIDFile, MailServer, FName, Mname , CertPassword, MLocation, Comment, UserMailPath, , UserPassword) Then
Msgbox("User was Registered Successfully")
Else
Msgbox("Sorry, User was Not Registered, Please try again")
End If

Supporting Information:
From the Domino Designer Online Help entry on the RegisterNewUser method (of the NotesRegistration class):

RegisterNewUser

Creates a user ID and optionally adds it to a Domino Directory.

Defined in
NotesRegistration

Syntax
variant = notesRegistration.RegisterNewUser( lastname$, idfile$, mailserver$ [, firstname$ [, middle$ [, certpw$ [, location$ [, comment$ [, maildbpath$ [, fwddomain$ [, userpw$ [, usertype% [, altname [, altnamelang ]]]]]]]]]]] )

Parameters
lastname$
String. The last name of the user to be registered.
idfile$
String. The ID file to be created; specify the complete path, for example, c:\notes\data\user.id.
mailserver$
String. The canonical name of the server containing the user's mail file.
firstname$
String. A first name for the user.
middle$
String. A middle initial for the user.
certpw$
String. The password of the certifier ID file.
location$
String. A value for the location field in the Domino Directory record.
comment$
String. A value for the comment field in the Domino Directory record.
maildbpath$
String. The path of the user's mail file relative to the mail directory; for example, mail\jones.nsf.
fwddomain$
String. The forwarding domain for the user's mail file.
userpw$
String. A password for the user ID file.
usertype%

Note: This parameter is new with Release 5.
Constant of type Integer. Indicates the type of client to be created. May be one of the following.
NOTES_DESKTOP_CLIENT (175)    Desktop client
NOTES_FULL _CLIENT (176)    Default, full client
NOTES_LIMITED_CLIENT (174)    Mail client
altname
Note: This parameter is new with Release 5.0.2.
String. An alternate user name.
altnamelang
Note: This parameter is new with Release 5.0.2.
String. The language for the alternate user name. See @Locale in the formula language for a list of language codes.

Usage
Before calling this method, set CertifierIDFile, Expiration (defaults to 2 years from now), IDTyle, and MinPasswordLength.

Change - Expiration now takes default.
Note: The expiration default is new with Release 6.0.3.

Set UpdateAddressBook True to add a Server record to the Domino Directory. Set StoreIDInAddressBook True to attach the ID to the Domino Directory record. These operations can be performed separately with AddUserToAddressBook.

Set OrgUnit to add an organizational unit to the ID name. Optionally set AltOrgUnit and AltOrgUnitLang.

Optionally set IsNorthAmerican and RegistrationLog.

This method acts on the Domino Directory (names.nsf) for the server specified by RegistrationServer, or names.nsf in the local Domino data directory if this property is not set.

  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (1)May 5, 2011, 2:27:57 PM~Bill Fezjipyskiakoi  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL Software
  • Privacy
  • Accessibility