【问题标题】:UnboundID LDAP - how to set flags in userAccountControl attributeUnboundID LDAP - 如何在 userAccountControl 属性中设置标志
【发布时间】:2013-07-15 08:05:39
【问题描述】:

我正在使用 UnboundID LDAP SDK 进行 ActiveDirectory 管理,并且我想创建新用户。我能够创建与 ActiveDirectory 的连接并添加具有某些属性的新用户,但我不知道如何使用属性 userAccountControl。 ActiveDirectory 使用此属性来存储一些标志,我不知道如何使用 UnboundID LDAP SDK 设置这些标志。感谢您的帮助。

关于属性 userAccountControl 的一些信息 http://msdn.microsoft.com/en-us/library/windows/desktop/ms680832(v=vs.85).aspx

【问题讨论】:

    标签: java active-directory ldap unboundid-ldap-sdk


    【解决方案1】:

    发现路径不对,这里是修改userAccountControl的代码

    Modification mod = new Modification(ModificationType.REPLACE, "userAccountControl", usr.getUAC().toString());
    ModifyRequest req = new ModifyRequest(userCN + userOU, mod);
    LDAPResult modResult = connection.modify(req);
    

    【讨论】:

      【解决方案2】:

      userAccountControl 是位掩码,所以需要设置为整数。

      我们在此处记录了一些价值观和信息: http://ldapwiki.willeke.com/wiki/User-Account-Control%20Attribute%20Values

      如果您说出您尝试在 userAccountControl 中设置的内容并提供您正在使用的代码,可能会有所帮助。

      【讨论】:

      • 感谢您的回复,我发现问题是一些错误的路径:)
      猜你喜欢
      • 1970-01-01
      • 2019-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 2017-03-01
      相关资源
      最近更新 更多