大网数据广告活动
域与目录服务

Defining a New Attribute

· 52CE 我爱测

This topic shows how to define a new attribute when extending the Active Directory schema.

This topic shows how to define a new attribute when extending the Active Directory schema.

Consider the following when defining a new attribute:

  • Use existing attributes when possible.
  • Always use the cn ("common name") property as the naming (relative distinguished name) attribute. This is the default for most classes, including those derived directly from Top. The cn property is an indexed property and will make searching for objects by name more efficient.
  • Large multi-valued attributes are costly to store and retrieve and should be avoided. Active Directory Domain Services implement an LDAP extension to enable incremental read of large properties with multiple values, but not all LDAP clients will recognize this extension.
  • Remember that attributes are flat, that is there is no implied substructure to an attribute. All attributes in a given class should relate directly to instances of that class.

Creating a New Attribute

To create a new attribute:

  • Choose a name for the attribute. The name will be contained in the cn and lDAPDisplayName attributes. For more information about composing a name for a new attribute, see Naming Attributes and Classes.

  • Obtain an object identifier (OID) for the attribute. For more information, see Obtaining a Root Object Identifier.

  • Choose a syntax for the attribute. The syntax is determined by the combination of the oMSyntax and oMObjectClass attributes. For more information, see Choosing a Syntax.

  • Decide if the attribute is single or multi-valued. The isSingleValued attribute determines if the attribute is single or multi-valued.

  • Decide if the attribute should be indexed by default. For more information, see Indexed Attributes.

  • Decide if the attribute should be in the global catalog by default. For more information, see Attributes Included in the Global Catalog.

  • If the attribute is an integer or string, decide if a range limit is required. The rangeLower and rangeUpper attributes are used to specify the range limit.

  • If the attribute is DN-valued, decide if the attribute should be linked with another attribute. If so, the linkID attribute must be set appropriately on each attribute; one attribute must be a forward link, the other a back link. For more information about linked attributes, see Linked Attributes.

  • Create a new attributeSchema object in the schema container and set the appropriate attributes for the object. There are a large number of attributes that can be set for an attributeSchema object, but the attributes listed in the following table below are critical to the definition of a new attribute. The values of these attributes are determined by the previous steps. For more information about these attributes, see Characteristics of Attributes.

    Attribute Comment
    cn Required.
    lDAPDisplayName Required.
    adminDisplayName Required.
    attributeSyntax Required.
    oMSyntax Required.
    oMObjectClass Required.
    schemaIDGUID Required.
    attributeID Required.
    isSingleValued Required.
    searchFlags Required.
    isMemberOfPartialAttributeSet Required.
    rangeLower Optional.
    rangeUpper Optional.
    linkID Optional. Required for linked attributes.
    description Optional.
  • Commit the new attributeSchema object to the schema container.

  • Update the schema cache, if necessary. For more information, see Updating the Schema Cache.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。