Hello Folks,
Can anyone help me to create custom attribute in CA directory?Is there any command for it?
Hello Folks,
Can anyone help me to create custom attribute in CA directory?Is there any command for it?
For directories, the structure of the directory information tree (DIT) is tightly controlled by the schema. The schema defines rules that control structure (name bindings) and content (object classes, attributes).
An object class controls which attributes must or may be present in an object (entry).
The best way to extend the schema of an existing entry to include a custom attribute is to define
* An auxiliary object class
* A custom attribute
* Assign the new object class to the entry while instantiating the customer attribute
You can also subclass an existing object class and extend with custom attributes (which includes the must and may contain attribute list of the superior object class). I will just go through adding an auxiliary object class.
1. Choose an object identifier (OID). There has been some discussion in this forum about how which object identifiers to use when customizing the the schema so I won't cover that here. Say we have been assigned (1.3.6.1.4.1.3327.1000). You can take an arc from and existing OID as long as there's no chance of conflict with other OIDs.
2. Create a file called $DXHOME/config/schema/custom.dxc
3. Source the new schema file "custom.dxc" from what schema group file sourced by $DXHOME/config/servers/{dsa_name}.dxi. For example, add source "custom.dxc"; to $DXHOME/config/schema/default.dxg
4. Add a custom attribute and auxiliary object class to the new custom schema file:
schema set oid-prefix custom-oc = (1.3.6.1.4.1.3327.1000.1);
schema set oid-prefix custom-attr = (1.3.6.1.4.1.3327.1000.2);
schema set attribute custom-attr:1 = {
name = customAttribute
syntax = caseIgnoreString
};
set object-class custom-oc:1 = {
name = customOC
subclass-of top
kind = auxiliary
may-contain
customAttribute
};
5. Add new object class to entry containing custom attribute:
dn: cn=joe,ou=users,c=au
objectClass: inetOrgPerson, customOC
surname: blogs
customAttribute: value1
For directories, the structure of the directory information tree (DIT) is tightly controlled by the schema. The schema defines rules that control structure (name bindings) and content (object classes, attributes).
An object class controls which attributes must or may be present in an object (entry).
The best way to extend the schema of an existing entry to include a custom attribute is to define
* An auxiliary object class
* A custom attribute
* Assign the new object class to the entry while instantiating the customer attribute
You can also subclass an existing object class and extend with custom attributes (which includes the must and may contain attribute list of the superior object class). I will just go through adding an auxiliary object class.
1. Choose an object identifier (OID). There has been some discussion in this forum about how which object identifiers to use when customizing the the schema so I won't cover that here. Say we have been assigned (1.3.6.1.4.1.3327.1000). You can take an arc from and existing OID as long as there's no chance of conflict with other OIDs.
2. Create a file called $DXHOME/config/schema/custom.dxc
3. Source the new schema file "custom.dxc" from what schema group file sourced by $DXHOME/config/servers/{dsa_name}.dxi. For example, add source "custom.dxc"; to $DXHOME/config/schema/default.dxg
4. Add a custom attribute and auxiliary object class to the new custom schema file:
schema set oid-prefix custom-oc = (1.3.6.1.4.1.3327.1000.1);
schema set oid-prefix custom-attr = (1.3.6.1.4.1.3327.1000.2);
schema set attribute custom-attr:1 = {
name = customAttribute
syntax = caseIgnoreString
};
set object-class custom-oc:1 = {
name = customOC
subclass-of top
kind = auxiliary
may-contain
customAttribute
};
5. Add new object class to entry containing custom attribute:
dn: cn=joe,ou=users,c=au
objectClass: inetOrgPerson, customOC
surname: blogs
customAttribute: value1