[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: How to create ou



On Dienstag, 11. Juni 2002 13:44, Andreas Moroder wrote:

[...]

> if I call
>
> ldapadd -W -v -D uid=cyrus,dc=sb-brixen,dc=it -f hosts.ldif
>
> I get
>
> ldap_add: Object class violation
> 
> the hosts.ldif looks like
>
> dn: ou=Hosts, dc=sb-brixen,dc=it
> createtimestamp: 20010524065817Z
> modifiersname: uid=cyrus,dc=sb-brixen,dc=it
> modifytimestamp: 20010524065817Z
> creatorsname: uid=cyrus,dc=sb-brixen,dc=it
> ou: Hosts
> objectclass: top


The "Object class violation" usually means that you violate object class 
restrictions ;-)

To be precise: the attribute "ou" must be defined in the objectclass 
which you use. There are several objectclasses which do this, one of 
which is organizationalUnit (others are organizationalRole, 
organizationalPerson, groupOfUniqueNames, groupOfNames, device, 
applicationProcess, applicationEntity, but this depends on your schema 
configuration -> BTW a great free LDAP client with schema browser, for 
Linux/Unix is gq (http://biot.com/gq/)). 


So add a line like "objectclass: organizationalUnit" to your ldif, and 
get rid of the createtimestamp, modifiersname, modifytimestamp and 
creatorsname attributes (which will be set automatically by the server, 
and are not supposed to be set explicitly in an ldapadd operation (they 
may be useful in a slapadd operation, but I am not sure about that)).


Hope it helps, and greetings to Suedtirol,

Hans

-- 
Hans.Aschauer@Physik.uni-muenchen.de