【问题标题】:Import object class definitions to Active Directory (AD LDS)将对象类定义导入 Active Directory (AD LDS)
【发布时间】:2014-06-20 10:46:46
【问题描述】:

我无法将对象类定义从 OpenDS 迁移到 Active Directory。我已经成功迁移了 一些 定义(并且可以使用我的 Java 应用程序读取/写入 AD) - 但现在我被卡住了。

在我的 OpenDS 架构描述中,我有这样的内容:

objectClasses: ( 1.3.6.1.4.1.99.2
  NAME 'myNewClass'
  SUP top STRUCTURAL
  MUST ( myAttribute1 $ myAttribute2 $ myAttribute3 )
  MAY someOtherAttribute
  )

我将它翻译成这样的 AD 架构语法:

# Class: myNewClass
dn: cn=myNewClass,cn=Schema,cn=Configuration,dc=X
changetype: add
objectClass: classSchema
governsID: 1.3.6.1.4.1.99.2
ldapDisplayName: myNewClass
adminDisplayName: myNewClass
objectClassCategory: 0
systemOnly: FALSE
# subclassOf: top
subclassOf: 2.5.6.0
# rdnAttId: myAttribute1 
rdnAttId: 1.3.6.1.4.1.99.1
# mustContain: myAttribute2 
mustContain: 1.3.6.1.4.1.99.2
# mustContain: myAttribute3 
mustContain: 1.3.6.1.4.1.99.3
# mayContain: someOtherAttribute
mayContain: 1.3.6.1.4.1.99.4
# possSuperiors: organizationalUnit
possSuperiors: 2.5.6.5
# defaultObjectCategory: myNewClass
defaultObjectCategory: cn=myNewClass,cn=Schema,cn=Configuration,dc=X

但是当我尝试编写 myNewClass 类的对象时,我得到了这个异常:

javax.naming.InvalidNameException: "myAttribute1=Read+myAttribute2=Allow+myAttribute3=cn\=someResource": [LDAP: error code 34 - 0000208F: LdapErr: DSID-0C090715, comment: Error processing name, data 0, v1db1 ];

我认为问题是 rdnAttId,这在 AD 中似乎是必不可少的(而不是在 OpenDS 中)。我只能将它设置为单个值(所以我选择了 myAttribute1),但它不应该更像 myAttribute1 AND myAttribute2 AND myAttribute3 吗?

做什么?

【问题讨论】:

    标签: active-directory ldif opends


    【解决方案1】:

    好的,这里是一个带有类创建的 LDIF 示例。你应该听从我的建议。首先,您使用 Microsoft 管理控制台创建它,然后使用 LDIFDE.EXE 将其导出,清理您的 LDIFDE,然后您可以将其导入其他 AD。

    dn: CN=SlxOeuvre,CN=Schema,CN=Configuration,DC=XXXX
    changetype: add
    objectClass: top
    objectClass: classSchema
    cn: SlxOeuvre
    distinguishedName: CN=SlxOeuvre,CN=Schema,CN=Configuration,DC=XXXX
    instanceType: 4
    possSuperiors: organizationalUnit
    subClassOf: top
    governsID: 1.3.6.1.4.1.10558.2.2.1
    mustContain: SlxTitre
    mayContain: SlxChapitres
    mayContain: SlxEditeur
    mayContain: SlxGenre
    mayContain: SlxLangue
    mayContain: SlxPages
    rDNAttID: cn
    showInAdvancedViewOnly: TRUE
    adminDisplayName: SlxOeuvre
    objectClassCategory: 1
    lDAPDisplayName: SlxOeuvre
    name: SlxOeuvre
    systemOnly: FALSE
    

    在 Active-Directory 中 rDNAttID 是用于创建相对可分辨名称的属性名称。从理论上讲,您可以选择您想要的。从实用的角度来看,除了CN,我从不使用其他任何东西。


    已编辑:

    创建属性后,请小心重新加载架构,以便它们可用于创建类。这是换向器:

    dn:
    changetype: modify
    add: schemaUpdateNow
    schemaUpdateNow: 1
    -
    

    已编辑:

    由于您的 DN 是 cn=myNewClass,cn=Schema,cn=Configuration,dc=X,因此您必须将 CN 添加到属性 dn:cn:myNewClass(应该自动添加)。


    编辑: 根据Microsoft documentation

    就RDN而言,Active-Directory模型和LDAP数据模型的对应关系如下。具有其属性和值的对象对应于具有其属性和值的 LDAP 条目。该模型和 LDAP 就 objectClass 属性的定义达成一致。该模型中RDN的定义是LDAP定义的一个子集;此模型中的所有 RDN 都是有效的 LDAP RDN,但反之则不然。例如,以下多值 RDN 是有效的 LDAP RDN,但在此模型中无效:“cn=Peter Houston+employeeID=ABC123”。给定 RDN 定义,该模型中 DN 的定义与 LDAP 的定义相同。在 LDAP 数据模型中,子-父关系用子和父的 DN 表示,而在 Active Directory 数据模型中,子-父关系用父属性表示并派生 DN。 Active Directory 不通过 LDAP 公开模型的父属性。

    【讨论】:

    • 我遇到的问题是:我的对象类定义中没有CN(这个类的对象只定义了myAttribute1 + myAttribute2 + myAttribute3)。嗯......也许rDNAttID根本不是问题?你如何解释我得到的 Java 异常?
    • @Frizz 我不是很懂 java 错误,你为什么不尝试第一次用 MMC 创建类,然后导出 LDIFF?
    • 我不能使用 MMC,因为它不允许我创建属性或类(“创建类...”和“创建属性...”是灰色的)。我以管理员身份启动它,但仍然显示为灰色。
    • Windows Server 2008 R2 标准 64 位
    • 因为我的RDN是多值的(myAttribute1 + myAttribute2 + myAttribute3):如何正确设置rdnAttId?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-22
    相关资源
    最近更新 更多