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

Choosing a Syntax

· 52CE 我爱测

This topic contains a list of recommended syntaxes to use when defining a new attribute.

There are 23 syntaxes defined in Active Directory Domain Services. This topic contains a list of recommended syntaxes to use when defining a new attribute.For more information, see Syntaxes for Attributes in Active Directory Domain Services.

The following table provides a list of recommendations.

Data to store in attribute Syntax to use Comment
Binary data String(Octet) Use to store binary data. This is an array of bytes.
Binary data with a DN reference Object(DN-Binary) Contains a binary value and a distinguished name (DN). The Active Directory server keeps the DN up-to-date.
Boolean Boolean Use for boolean values.
DN Reference Object(DS-DN) Use to store distinguished names that you want kept up-to-date by the Active Directory server. When an attribute of DN syntax is created with a valid DN, the server treats the attribute as a reference to the object represented by the DN that was set. If the referenced object is renamed or moved, the server ensures that the attribute reflects the change. If the attribute is reset with a new DN, the attribute is reference to the object represented by the new DN.
Integer Integer Use for integers.
Large Integer (64-bit values) LargeInteger Use for 64-bit values.
Linked DN Object(DS-DN) This string syntax can be used for linked DNs. Back links must be of syntax DN. Forward links can be of syntax DN as well as Object(DN-String), Object(DN-Binary), Object(Access-Point), or Object(OR-Name). Linked attributes must have a linkID defined. See the description of linkID in Attribute-Schema properties.
Security Descriptor String(NT-Sec-Desc) Octet string containing a security descriptor.
Security Identifier (SID) String(Sid) Octet string containing a security identifier (SID). Use this syntax to store SID values only.
String String(Unicode) Use for most string attributes. It supports the Unicode character set. When the Active Directory server performs comparisons against attributes of this syntax (such as evaluating a query), it performs case-insensitive comparisons. Use the other string syntaxes (String(IA5), String(Numeric), and so on) to store strings that should contain only the specific character sets supported by the syntax.
String data with a DN reference Object(DN-String) String containing a string value and a distinguished name (DN). The Active Directory server keeps the DN up-to-date.
Time String(Generalized-Time) Use the String(Generalized-Time) syntax to store time values rather than the String(UTC-Time) syntax because String(Generalized-Time) uses four characters for the year and String(UTC-Time) uses only two.

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)

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

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