RegisterNewUser error message

Hi fellow lotus notes guinnea pigs! :wink:

I am trying to automate the creation of a user. I use the following line of code in which I have hard coded the values to try and fix the problem I am getting.

var = reg.RegisterNewUser(“Pengwilly”, _ 'last name

	"C:\temp\idfile.id", _

	"Norwich003/MoneyCentre", _ 

	"Stephen", _  'first name

	"F", _ 'middle name

	"NorwichCert2006", _ 'password for certifier id

	"W:\Lotus Special IDs\Special IDs\norwichcert.id", _ 'path of certifier id file

	"", _

	"mail\norwich\mailfile.nsf", _

	"", _

	"pa55word", _     'user password

	176, _    'user type (Full Notes)

	"", _

	"")

Also I have set the following variables of the notesregistration object at the top of my code…

reg.IDType = 173 'Heirarchical

Call expirationdate.adjustyear(2)

reg.Expiration = Cdat(expirationdate.dateonly) 'Certificate expiration date

reg.CreateMailDB = True ' Create a mail file

reg.IsNorthAmerican = False 'international id

reg.MailQuotaSizeLimit = 500 'quota

reg.MailQuotaWarningThreshold = 400 'quota warning threshold

reg.MailReplicaServers = "Iceni_Hub" 'put a replica of the mail file on our mail cluster

reg.MailTemplateName = "TestMCR7Mail" 'new R7 mai ltemplate

reg.StoreIDInAddressBook = False 'we don't want the ID in the address book

reg.StoreIDInMailFile = False ' we don't want the ID in the mail file

reg.RegistrationServer = "Norwich004/MoneyCentre" 'the users home server

reg.CertifierIDFile = CertFileLocation(doc.Office(0)).PATH

reg.minpasswordlength = 7

reg.grouplist = groups

All folder specified exist but when i run this line of code i get the following error

Notes error: File does not exist (Pengwilly).

I just can’t see what would be causing this. I have re’written the line to make sure I didn’t type anything wrong. I have also checked that I have sufficient access to run this command on our servers, which I do :slight_smile:

Any help from the resident gurus would be hugely appreciated.

Subject: RegisterNewUser error message

As the error is quite unspecific I’ll take a guess (sorry if I’m wrong):

reg.MailTemplateName = “TestMCR7Mail” 'new R7 mai ltemplate

Is “TestMCR7Mail” the template name or the template filename? I have a feeling it needs to be the template filename (e.g., “iNotes6.ntf” or similar).

Also the parameter…

“W:\Lotus Special IDs\Special IDs\norwichcert.id”

… is in the “$location” parameter position. I notice you specify the cert id via the registration object’s properties so suppose this won’t be an issue but thought it worth mentioning.

I’ve used the class several times and it definitely works so you should get it working (eventually!).

Let us know how you get on… :slight_smile: