Platform SDK: Active Directory, ADSI, and Directory Services |
Schema additions are permanent. You cannot delete attributeSchema and classSchema objects. This is because in a highly distributed system such as Microsoft® Windows® 2000 it is impossible to guarantee that there are no instances of a given class or attribute. Removing the definition of a class or attribute would damage any existing instances of that class or attribute.
Instead, you can disable an existing class or attribute by marking it "defunct". This does not affect any existing instances of the class or attribute so marked, but it prevents new instances from being created.
Disabling schema classes and attributes is subject to the following restrictions:
To disable an attribute, set the isDefunct attribute of its attributeSchema object to "True". When an attribute is disabled, new instances of the attribute can no longer be created. To re-enable the attribute set the isDefunct attribute to "False".
To disable a class, set the isDefunct attribute of its classSchema object to "True". When a class is disabled, new instances of the class can no longer be created. To re-enable the class set the isDefunct attribute to "False".
Making schema objects defunct can be useful in production environments. When a test version of a schema extension is no longer needed, clean it up by making it defunct. If you decide later that the defunct schema object is useful, you can quickly restore it by simply removing the isDefunct property or setting it to FALSE. This also protects against accidental removal of a schema object by making it defunct because the operation can be easily reversed with no side-effects.
Note that Active Directory™ does not clean up existing instances of an attribute or class when you make a schema object defunct. So if you remove the isDefunct property, any instances become valid, normal objects again.
Other consequences of marking an attributeSchema or classSchema object defunct are the following:
Other options in a production environment for reducing the impact of defunct schema extensions include.
Other alternatives for getting rid of unwanted schema changes in a production environment are for developers to use a private domain controller for testing. In this case, you can do either of the following: