【问题标题】:lotus script to get register use OU and O?使用 OU 和 O 获取寄存器的 lotus 脚本?
【发布时间】:2017-08-01 01:55:04
【问题描述】:

我正在尝试从新创建的用户 ID 中获取 OU 和 O

TestUser1.id

问题:我想获取新注册 ID 的完整路径。

1) 未登录到该帐户以返回用户 ID 信息?

完整路径 = CN=TestUser1/OU=Software/O=pcs

Sub Initialize
  Dim session As New NotesSession
  Dim adminp As NotesAdministrationProcess
  Set adminp = _
  session.CreateAdministrationProcess(mailsvr)
  noteid$ = adminp.SetUserPasswordSettings( _
  "CN=TestUsesr1/OU=Software/O=pcs", PWD_CHK_LOCKOUT, 0, 0, True)
  If noteid$<> "" Then
    Dim db As New NotesDatabase(mailsvr, "admin4.nsf")
    Dim ws As New NotesUIWorkspace
    Call ws.EditDocument(False, db.GetDocumentByID(noteid$))
  End If
End Sub

其实我真正想做的是强制用户第一次登录一个帐户来强制用户更改他/她的http密码

我不确定这对于新创建的 ID 是否正确?

以下链接与此主题相关:

force notes user to change password / internet password on next login using lotus script

【问题讨论】:

    标签: lotus-notes lotusscript


    【解决方案1】:

    正如您在链接问题中已经部分回答的那样,强制用户更改其互联网密码非常容易:

    • 从服务器 names.nsf 获取用户文档
    • 将字段 HTTPPasswordForceChange 设置为“1”

    这里是一些示例代码(没有错误处理,没有语法检查)。 从文档中您的 adminp- 示例应该也可以工作,但是如果服务器配置为检查密码,它将锁定用户并且不允许他登录...

    Dim db as NotesDatabase  
    Dim viwUser as NotesView
    Dim docUser as NotesDocument
    Set db = New NotesDatabase( yourServer, "names.nsf" )
    Set viwUser = db.GetView( "($Users)" )
    Set docUser = viwUser.GetDocumentByKey( "CN=TestUsesr1/OU=Software/O=pcs" )
    Call docUser.ReplaceItemValue( "HTTPPasswordForceChange" , "1" )
    Call docUser.Save( True, True, True )
    

    【讨论】:

    • 谢谢,我浪费了这么多天来寻找注册和管理过程的解决方案......谁知道只需要修改通讯录。已经可以了。非常感谢~
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-02
    • 2012-03-23
    • 2017-10-13
    • 1970-01-01
    • 2011-10-25
    相关资源
    最近更新 更多