Expert Answer Center > Experts On Demand > View Answer
EMAIL THIS
Experts on Demand
  EXPERTS ON DEMAND HOME     POSE A QUESTION     VIEW ANSWERS     BROWSE BY TOPIC        RSS FEEDS  
Is it possible to programmatically create a new Notes user? The data of the new user would come from a number of places -- a form (in a request DB that was created from another application or entered by an admin), a spreadsheet and so on. QUESTION POSED ON: 06 JUN 2005
QUESTION ANSWERED BY: Mathew Newman Yes, you can create a new user programmatically through LotusScript. Specifically, check out the "NotesRegistration" class in Domino Designer help and the associated "RegisterNewUser" method of that class.

Performing this operation from a Notes form is relatively straightforward if the form has all of the settings required by the RegisterNewUser parameters. Otherwise, you will have to add new fields to the form, prompt for the additional settings or write static options into the code itself.

If you want to pick out these settings from a spreadsheet, that's only more complex by virtue of having to access the spreadsheet first and then looping through the rows and cells to retrieve your registration options.

The following example is from Designer help.

This agent registers JYIP.ID with CERT.ID.
Sub Initialize
 Dim session As New NotesSession
 Dim reg As New NotesRegistration
 dt = Datenumber(Year(Today)+1, Month(Today), Day(Today))
 reg.RegistrationServer = "AceOne"
 reg.CreateMailDb = False
 reg.CertifierIDFile = "c:\NotesAdministrator\cert.id"
 reg.Expiration = dt
 reg.IDType = ID_HIERARCHICAL
 reg.MinPasswordLength = 5          ' password strength
 reg.IsNorthAmerican = True
 reg.OrgUnit = "AceHardwareNE"
 reg.RegistrationLog = "log.nsf"
 reg.UpdateAddressBook = True
 reg.StoreIDInAddressBook = True
 Call reg.RegisterNewUser("Yip", _  ' last name
 "c:\NotesAdministrator\jyip.id", _ ' file to be created
 "CN=Mail_AceOne/O=AceHardware", _  ' mail server
 "Jimmy", _                         ' first name
 "", _                              ' middle initial
 "AceHardware", _                   ' certifier password
 "", _                              ' location field
 "", _                              ' comment field
 "jyip.nsf", _                      ' mail file
 "", _                              ' forwarding domain
 "AceHardware", _                   ' user password
 NOTES_DESKTOP_CLIENT)              ' user type
End Sub 
HomeExperts on DemandIT Expert Webcast SeriesExpert KnowledgebaseSite Index
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts