9.3.1 Behavior of Alias Objects
9.3.1.1 Binding to an Alias Object
Alias objects are typically used to leave a "placeholder" in the namespace when an object has been moved. The desired default behavior for an alias is to return the object it (the alias) points to when referenced. Active Directory Alias objects support this usage in their binding behavior. When an alias object is bound via GetObject or ADsGetObject, the aliased object is returned unless the alias object is explicitly requested.
For example, given an alias object "MyAlias" that points to a print queue object "MyPrintQ":
Dim ReturnedObject as IADs
set ReturnedOBject = GetObject("@NS!Container\MyAlias")
will return "MyPrintQ", and
Dim ReturnedObject as IADs
set ReturnedOBject = GetObject("@NS!Container\MyAlias","alias")
will return the alias object "MyAlias".
9.3.1.2 Deleting an Alias Object
Deleting an Alias object deletes the Alias, not the object it points to.
9.3.1.3 Creating an Alias Object
Creation of an alias in a container is no different than creating any other object. The target of the alias is set by setting the AliasedObject property in the alias to the ADsPath of the target.
9.3.1.4 Enumeration Behavior of Alias Objects
Alias objects are not automatically dereferenced during enumeration. An application can request Alias objects during enumeration by
- enumerating all objects regardless of type
- setting a filter that explicitly includes Alias objects
For example, an application that wants to list all User objects in a container, including aliases to user objects, can set a filter value of "user" and "alias" and discard aliases that do not point to users during the enumeration.