dn: cn=jsmith,cn=users,dc=rallencorp,dc=com changetype: add objectClass: user objectClass: dynamicObject entryTTL: 1800 sAMAccountName: jsmith
then run the following command:
> ldifde -v -i -f create_dynamic_object.ldf
' This code creates a dynamic user object with a TTL of 30 minutes (1800 secs) set objUsersCont = GetObject("LDAP://cn=users,dc=rallencorp,dc=com") set objUser = objUsersCont.Create("user", "CN=jsmith") objUser.Put "objectClass", "dynamicObject" objUser.Put "entryTTL", 1800 objUser.Put "sAMAccountName", "jsmith" ' mandatory attribute objUser.SetInfo
The ability to create dynamic objects is a new feature in Windows
Server 2003. To create a dynamic object, you simply need to specify
objectClass to have a value of
dynamicObject in addition to its structural
when instantiating the object. The
attribute can also be set to the number of seconds before the object
is automatically deleted. If
entryTTL is not set,
the object will use the
attribute specified in the domain. The
cannot be lower than the
the domain. See Recipe 4.16 for more
information on how to view and modify these default values.
Dynamic objects have a few special properties worth noting:
A static object cannot be turned into a dynamic object. The object must be marked as dynamic when it is created.
Dynamic objects cannot be created in the Configuration NC and Schema NC.
Dynamic objects do not leave behind tombstone objects.
Dynamic objects that are containers cannot have static child objects.