Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Add objectClass with ldapmodify

  1. #1
    Join Date
    Aug 2010
    Location
    In yours
    Posts
    93
    Rep Power
    5

    Default Add objectClass with ldapmodify

    Hi again.

    I want to add a new objectClass inside of a ou and it requires to used a new attribute with out exceptions:


    Before:
    Code:
    # people, zimbracorreo.com
    dn: ou=people,dc=zimbracorreo,dc=com
    ou: people
    objectClass: organizationalRole
    cn: people
    After:

    Code:
    # people, zimbracorreo.com
    dn: ou=people,dc=zimbracorreo,dc=com
    ou: people
    objectClass: organizationalRole
    objectClass: myObjectClass
    
    IdOur: 1245   (new attributo requires with myObjectClass)
    cn: people

    I'm trying with ldapmodify but I'm wrong:

    Code:
      1 dn: ou=people,dc=zimbracorreo,dc=com
      2 changetype: modify
      3 
      4 objectClass: myObjectClass
      5 idOur:1245
    Anyones know what is happened ?

    Thanks so much!

  2. #2
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    Do it with zmprov

    Code:
    zmprov ma <account> +objectClass myObjectClass +idOur 1245
    To do it on all accounts

    Code:
    zmprov -l gaa > /tmp/1
    for i in $(cat /tmp/1); do echo ma $i +objectClass myObjectClass +idOur 1245; done > /tmp/2
    zmprov < /tmp/2
    rm -f /tmp/1 /tmp/1

  3. #3
    Join Date
    Aug 2010
    Location
    In yours
    Posts
    93
    Rep Power
    5

    Default

    zmprov ma 0123456N@zimbra.com +objectClass myObjectClass +idOur 1245
    ERROR: service.INVALID_REQUEST (invalid request: LDAP schema violation: [LDAP: error code 65 - invalid structural object class chain (organizationalPerson/myObjectClass)])


    this object class is an schema that it calls: MySchema.ldif, this schema is complete add, because i can create new entries with this object class but i can't modify the other parts of the tree

  4. #4
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    Can you post your MySchema.ldif? What Zimbra Version do you use?

  5. #5
    Join Date
    Aug 2010
    Location
    In yours
    Posts
    93
    Rep Power
    5

    Default

    Code:
    dn: cn={13}myObjectClass
    objectClass: olcSchemaConfig
    cn: {13}myObjectClass
    olcAttributeTypes: {0}( 2.3.3.3.5.4 NAME 'nombre' EQUALITY caseIgnoreMatch SUB
     STR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{30} )
    olcAttributeTypes: {1}( 2.3.3.3.5.5 NAME 'autor' EQUALITY caseIgnoreMatch SUBS
     TR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
    olcAttributeTypes: {2}( 2.3.3.3.5.6 NAME 'fechaImplantacion' EQUALITY caseIgno
     reMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
     {10} )
    olcAttributeTypes: {3}( 2.3.3.3.5.7 NAME 'descripcion' EQUALITY caseIgnoreMatc
     h SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
    olcAttributeTypes: {4}( 2.3.3.3.5.8 NAME 'uri' EQUALITY caseIgnoreMatch SUBSTR
      caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
    olcAttributeTypes: {5}( 2.3.3.3.5.9 NAME 'plataforma' EQUALITY caseIgnoreMatch
      SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
    olcAttributeTypes: {6}( 2.3.3.3.5.10 NAME 'version' EQUALITY caseIgnoreMatch S
     UBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{20} )
    olcAttributeTypes: {7}( 2.3.3.3.5.11 NAME 'tipo' EQUALITY caseIgnoreMatch SUBS
     TR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{10} )
    olcAttributeTypes: {8}( 2.3.3.3.5.12 NAME 'usuario' EQUALITY caseExactIA5Match
      SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
    olcAttributeTypes: {9}( 2.3.3.3.5.13 NAME 'administrador' EQUALITY caseExactIA
     5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.2
     6 )
    olcObjectClasses: {0}( 2.3.3.3.6.1 NAME 'myObjectClass' SUP top STRUCT
     URAL MUST nombre MAY ( autor $ fechaImplantacion $ descripcion $ uri $ plataf
     orma $ version $ tipo ) )
    structuralObjectClass: olcSchemaConfig
    entryUUID: 91fcca52-33a4-4bd6-84c9-ab4ba9d566a1
    creatorsName: cn=config
    createTimestamp: 20101021132838Z
    entryCSN: 20101021132838.500325Z#000000#000#000000
    modifiersName: cn=config
    modifyTimestamp: 20101021132838Z
    )

    I'm using 6.6 Open Source Edition

  6. #6
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    A LDAP object can only have one structal object class. If you want to use your object class with Zimbra, you have to change the type to AUXILIARY.

    See Chapter 3 LDAP Schemas, ObjectClasses and Attributes

  7. #7
    Join Date
    Aug 2010
    Location
    In yours
    Posts
    93
    Rep Power
    5

    Default

    all theses changes will be safe when I update Zimbra to a new version?

    and the last question:
    How can integer when Im going to create a new users include the new objectClass by default???

    thanks so much!
    Last edited by mnbvmnbv; 10-22-2010 at 06:27 AM.

  8. #8
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    Quote Originally Posted by mnbvmnbv View Post
    all theses changes will be safe when I update Zimbra to a new version?
    Yes, I think so, because nothing it's mentioned about a upgrade problem at Installing custom ldap schema 6.0 - Zimbra :: Wiki. But I'm not sure.

    Quote Originally Posted by mnbvmnbv View Post
    How can integer when Im going to create a new users include the new objectClass by default???
    You can add the object class to every new account with this command.
    Code:
    zmprov mcf +zimbraAccountExtraObjectClass myObjectClass
    But take care about setting the must-have attribute nombre for your object class. Maybe with a Zimlet or with zmprov.

  9. #9
    Join Date
    Aug 2010
    Location
    In yours
    Posts
    93
    Rep Power
    5

    Default

    Quote Originally Posted by jummo View Post

    You can add the object class to every new account with this command.
    Code:
    zmprov mcf +zimbraAccountExtraObjectClass myObjectClass
    But take care about setting the must-have attribute nombre for your object class. Maybe with a Zimlet or with zmprov.

    Thanks, my another question is its is possible to add an objectClass and some attributes have default value for new each account.

    In samba, i need this objectclass

    Code:
    objectclass ( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' SUP top AUXILIARY
    	DESC 'Samba 3.0 Auxilary SAM Account'
    	MUST ( uid $ sambaSID )
    	MAY  ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $
    	       sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $
    	       sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $
                   displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $
    	       sambaProfilePath $ description $ sambaUserWorkstations $
    	       sambaPrimaryGroupSID $ sambaDomainName $ sambaMungedDial $
    	       sambaBadPasswordCount $ sambaBadPasswordTime $
    	       sambaPasswordHistory $ sambaLogonHours))
    and use some attributes, but i have to add the MUST attributes and i dont want to use the zmprov. Is it possible???

    Thanks in Advanced

  10. #10
    Join Date
    Aug 2010
    Location
    In yours
    Posts
    93
    Rep Power
    5

    Default

    Quote Originally Posted by jummo View Post
    Yes, I think so, because nothing it's mentioned about a upgrade problem at Installing custom ldap schema 6.0 - Zimbra :: Wiki. But I'm not sure.



    You can add the object class to every new account with this command.
    Code:
    zmprov mcf +zimbraAccountExtraObjectClass myObjectClass
    But take care about setting the must-have attribute nombre for your object class. Maybe with a Zimlet or with zmprov.

    Is possible to assing some Object class for specific domains and for other domains not add this object class???

    Thanks!

Similar Threads

  1. Ldap authentication fails but ldapsearch works
    By jherington in forum Installation
    Replies: 3
    Last Post: 11-19-2007, 11:51 PM
  2. ldapmodify: modify operation type is missing at line 2
    By celeron in forum Administrators
    Replies: 0
    Last Post: 10-02-2007, 04:32 AM
  3. Active Directory Integration
    By yohanes in forum Administrators
    Replies: 6
    Last Post: 09-25-2007, 05:39 PM
  4. Zimbra + Samba LDAP, cannot add winxp
    By fajarpri in forum Installation
    Replies: 4
    Last Post: 07-08-2007, 12:45 PM
  5. Using Zimlet to add zimbra account
    By dzed in forum Zimlets
    Replies: 2
    Last Post: 05-05-2006, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •