Platform SDK: Active Directory, ADSI, and Directory Services

Defining a New Attribute

Consider the following before defining a new attribute:

To Create a New Attribute

Follow these steps to create a new attribute:

  1. Choose a name for the attribute. For information on composing a common-name and an LDAP display name for a new attribute, see Naming Attributes and Classes.
  2. Obtain an OID for the attribute. See Obtaining a Root Object Identifier (OID).
  3. Choose a syntax for the attribute The syntax is determined by the combination of oMSyntax and attributeSyntax. See Choosing a Syntax.
  4. Decide if the attribute is single or multi-valued
  5. Decide if the attribute should be indexed by default.
  6. Decide if the attribute should be in the global catalog by default.
  7. If the attribute is an integer or string, decide if a range limit is needed
  8. If the attribute is DN-valued, decide if the attribute should be linked with another attribute. If so, the linkID property must be set appropriately on each attribute (one attribute must be a forward link, the other a back link). The schema extension program must use an available set of link IDs. See Example Code for Finding the Next linkID.
  9. Create a new attributeSchema object. There are a large number of attributes that can be set for an attributeSchema object. The following attributes are critical to the definition of a new attribute. For descriptions of these attributes, see Characteristics of Attributes.
  10. Write the new attributeSchema object to the directory.
  11. Update the schema cache if necessary.