4.13. Dynamically Linking an Auxiliary Class
Tip
This recipe requires the Windows Server 2003 forest functional level.
Problem
You want to dynamically link an auxiliary class to an existing object instance.
Solution
In each solution below, an example of adding the custom
rallencorp-SalesUser auxiliary class to the
jsmith user object will be described.
Using a graphical user interface
Follow the directions for Recipe 4.11.
Edit the values for the
objectClassattribute.For “Value to add,” enter
rallencorp-SalesUser.Click Add.
Click OK twice.
Using a command-line interface
Create an LDIF file called dynamically_link_class.ldf with the following contents:
dn: cn=jsmith,cn=users,dc=rallencorp,dc=com changetype: modify add: objectClass objectClass: rallencorp-SalesUser -
then run the following command:
> ldifde -v -i -f dynamically_link_class.ldf
Using VBScript
const ADS_PROPERTY_APPEND = 3
set objUser = GetObject("LDAP://cn=jsmith,cn=users,dc=rallencorp,dc=com")
objUser.PutEx ADS_PROPERTY_APPEND,"objectClass",Array("rallencorp-SalesUser")
objUser.SetInfoDiscussion
Dynamically linking an auxiliary class to an object is an easy way to
use new attributes without modifying the object class definition in
the schema directly. In Windows 2000, auxiliary classes could only be
statically linked in the schema. With Windows Server 2003, you can
dynamically link them by appending the auxiliary class name to the
objectClass attribute of an object.
A situation in which it makes more sense to dynamically link auxiliary ...