535
社区成员
发帖
与我相关
我的任务
分享
Sub Initialize
On Error Goto errorhandler
Dim session As New notessession
Dim db As notesdatabase
Set db = session.currentdatabase
Dim reg As New NotesRegistration
reg.createmaildb = True
reg.certifieridfile = "E:\Lotus\Domino\data\cert.id"
reg.expiration = Today + 2190
reg.registrationserver = db.server
reg.idtype = ID_HIERARCHICAL
reg.isnorthamerican = True
reg.minpasswordlength = 5
reg.orgunit = "XX部门"
reg.RegistrationLog = "log.nsf"
reg.updateaddressbook = True
reg.storeidinaddressbook = True
Dim ShortName As String
Dim lastname As String
Dim FullName As String
Call reg.RegisterNewUser("张三", _ ' last name
"E:\Lotus\idss\hufeng.id", _ ' file to be created
"CN=MailTest/O=test", _ ' mail server
"", _ ' first name
"", _ ' middle initial
"password", _ ' certifier password
"", _ ' location field
"", _ ' comment field
"mail\zhangsan.nsf", _ ' mail file
"", _ ' forwarding domain
"password", _ ' user password
NOTES_LIMITED_CLIENT,_ ' user type
"zhangsan" ) 'altname
'通过lastname,在names.nsf中查找该用户
Dim dbnames As notesdatabase
Set dbnames = session.getdatabase("","names.nsf",False)
If dbnames.isopen = False Then
Call dbnames.open("","names.nsf")
End If
Dim vwperson As notesview
Set vwperson = dbnames.getview("($users)")
Dim docuser As notesdocument
Set docuser = vwperson.getdocumentbykey("张三")
docuser.httppassword = "password"
'增加shortname
docuser.shortname = "zhangsan"
Call docuser.save(True,False)
Print "<font size=2>用户帐号已经注册成功了</font>"
Print "<hr size=1 color=red>"
Print "点击这里<a href='javascript:history.back();'><font size=2>返回</font></a>"
Exit Sub
errorhandler:
Print Cstr(Erl)+" "+Error$
Exit Sub
End Sub