Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/
An object class defines a set of attributes required to describe an object. For example, an object class tempemployee is created, which contains attributes related to temporary employees, such as idnumber, dateofhire,
The basic types of assignmentlength. Object Class include the following types:
Groups
Locations
Organizations
People
1. Define object classes
Define an objece classes by defining its feature types, inheritance, and attributes.
Object class type:
The first one is: structural
Each entry must belong to only one structural object class, which defines the basic content of this entry. This object class reflects an object in the real world. This type is the most common.
The second is: structural
This type is used by superclass or templates that define other object classes. It defines a set of attributes that are shared by a group of structural object classes. If these object classes are defined as a subset of abstract class, they inherit the attributes defined by abstract class.
Third: aupoliciary
This type specifies attributes that can be related to an entry that belongs to a specific structral object class. Although an entry can only belong to a single structural object class, it can belong to the auxiliary object classes.
2. Inheritance of object classes
A new object class can be defined with the parent class and additional added or modified attributes. All object classes are inherited from abstract object class and are called top inheritance. They can also be inherited from other object classes. Abstract object class defines a series of attributes required and allowed for a specific entry. Object class inheritance depends on the sequence defined by the object class. An object class can only inherit the object class defined before it
3. Attributes
Each object class contains a set of required or optional attributes.
4. view object class
Idsldapsearch-B Cn = Schema-S base objectclass = * objectclasses
5. added the object class.
Idsldapmodify-D <admindn>-W <adminpw>-I <FILENAME>
Filename contains the following information:
DN: Cn = Schema
Changetype: Modify
Add: objectclasses
Objectclasses: (<myobjectclass-oId> name' <myobjectclass> 'desc' <an object class
I defined for my LDAP Application> 'sup' <objectclassinheritance>'
<Objectclasstype> must (<attribute1 >$ <attribute2>)
May (<attribute3 >$ <attribute4> ))
6. Edit an object class
Not all schemas can be modified,
Idsldapmodify-D <admindn>-W <adminpw>-I <FILENAME>
File in Filename refers
DN: Cn = Schema
Changetype: Modify
Replace: objectclasses
Objectclasses: (<myobjectclass-oId> name' <myobjectclass> 'desc' <an object class
I defined for my LDAP Application> 'sup' <newsuperiorclassobject>'
<Newobjectclasstype> must (<attribute1 >$ <attribute2>)
May (<attribute3 >$ <attribute4> ))
Note that the modification of the CN = schema entry is different from that of other entries, it only modifies the corresponding value, but does not delete all other object classes.
7. Copy the object class
First query the object class contained in this schema, idsldapsearch-B Cn = Schema-S base objectclass = * objectclasses, select the object class you want to copy, set the script, and execute
Idsldapmodify-D <admindn>-W <adminpw>-I <FILENAME>
The script content is as follows:
Changetype: Modify
Replace: objectclasses
Objectclasses: (<mynewobjectclass-oId> name' <mynewobjectclass>'
Desc '<A>'
Sup' <superiorclassobject> '<objectclasstype>
Must (<attribute1 >$ <attribute2>)
May (> attribute3 >$ <attribute4 >$ <attribute3> ))
8. Delete object class
Not all object classes can be modified at will.
Idsldapmodify-D <admindn>-W <adminpw>-I <FILENAME>
The filename content is like:
DN: Cn = Schema
Changetype: Modify
Delete: objectclasses
Objectclasses: (<myobjectclass-oId> name' <myobjectclass>'
Desc '<an>'
Sup' <objectclassinheritance> '<objectclasstype>
Must (<attribute1 >$ <attribute2>)>
May (<attribute3 >$ <attribute4> ))
Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/