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

Enabling Rename-Safe Binding with the otherWellKnownObjects Property

· 52CE 我爱测

Objects of the Container class have an otherWellKnownObjects attribute that you can use to associate a GUID with the distinguished name (DN) of a child object in the container.

Objects of the Container class have an otherWellKnownObjects attribute that you can use to associate a GUID with the distinguished name (DN) of a child object in the container. If the child object is moved or renamed, the Active Directory server updates the DN in the otherWellKnownObjects value for that child object. This enables use of the WKGUID binding feature to bind to the child object using the GUID and the DN of the container rather than the child object's DN.

The otherWellKnownObjects attribute is equivalent to the wellKnownObjects attribute except that applications and services can write an otherWellKnownObjects value, but only the system can write wellKnownObjects.

Using otherWellKnownObjects attribute and WKGUID binding is beneficial in the following situations where rename-safe binding is required in relation to a specific container object.

If a container object contains other important objects, or if important objects can be renamed or moved.

If the important objects exist for each instance of the container object. For example, the system uses the wellKnownObjects attribute of each domainDNS object to store a value for the Users container, which exists in every instance of a domainDNS object. This enables applications to bind to the Users container in a rename-safe way by specifying the well-known GUID and the DN of the domainDNS container. Applications can use a container's otherWellKnownObjects attribute similarly.

If you require rename-safe binding and/or search capability on the important objects.

To add rename-safe binding and search capabilities

  1. Add a value to the otherWellKnownObjects property of the container object when the important object is created within that container. The value contains the GUID that represents the well-known object. Be aware that this is not the objectGUID and the distinguishedName for that object.
  2. Use the WKGUID binding feature to bind to or search the important object.

The otherWellKnownObjects attribute can have multiple values and contains the GUID/DN tuples of well-known objects within the containers on which they are set. The otherWellKnownObjects attribute has the DNWithBinary syntax in which values have the following form:

B:<char count>:<well known GUID>:<object DN>

In this example, "<char count>" is the count of hexadecimal digits in "<well known GUID>", which is 32 (number of hex digits in a GUID) for both otherWellKnownObjects and wellKnownObjects. "<well known GUID>" is the hexadecimal digit representation of the well-known GUID. "<object DN>" is the distinguished name of the object represented by this WKO value. The server maintains the ObjectDN portion of each wellKnownObjects and otherWellKnownObjects value so that it contains the current distinguished name of the object originally specified when the value was created.

For example, if {df447b5e-aa5b-11d2-8d53-00c04f79ab81} is the well-known GUID of the MyObject object in the MyContainer container in the Fabrikam.com domain, the otherWellKnownObjects value would specify the well-known GUID and the DN of MyObject:

B:32:df447b5eaa5b11d28d5300c04f79ab81:cn=MyObject,cn=MyContainer,dc=Fabrikam,dc=com

To bind to this object, use the following WKGUID binding string that specifies the well-known GUID of the object and the DN of the container:

LDAP://<WKGUID=df447b5eaa5b11d28d5300c04f79ab81,cn=MyContainer,dc=Fabrikam,dc=com>

After binding to this object, you can use the ADSI COM interfaces to search, read, modify, or delete the object.

For more information and a code example that shows how to add an object to the otherWellKnownObjects attribute, see Example Code for Creating a Container Object.

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)

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

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