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

Re: removing a field from ldap entry



Hi Jason

> Did not get a chance to thank you. Your help worked like a charm.
> One thing I need to find out is all the options and variables I can use
to
> modify what is in my structure.

There are some links about it. You can view, for example:

http://www.novell.com/documentation/lg/nas4nw/usnas4nw/nasnwenu/ldapmod.html

> For instance, I have this entry:
> # Domain Users, Groups, courtesymortgage, com
> dn: cn=Domain Users,ou=Groups,dc=courtesymortgage,dc=com
> objectClass: posixGroup
> gidNumber: 201
> cn: Domain Users
> description: Windows Domain Users
> And I need to change: dn: cn=Domain
users,ou=Groups,dc=courtesymortgage,dc=com
> to
> dn: cn=DomainUsers,ou=Groups,dc=courtesymortgage,dc=com
> I would imagine there is some type of modify option I can use in
> conjunction with a .ldif file?

Hum. I think you can try to create one .ldif file with this:

dn: cn=Domain Users,ou=Groups,dc=courtesymortgage,dc=com
changetype: modrdn
newrdn: cn=DomainUsers
deleteoldrdn: 0

With the last parameter, the old DN won´t be deleted, but a new CN entry
will appears, that is, one entry with "cn: Domain Users" will be
maintained. Then, you needs to erase it manually or with another .ldif
file. For example:

dn: cn=DomainUsers,ou=Groups,dc=courtesymortgage,dc=com
changetype: modify
delete: cn
cn: Domain Users

The command to run is the same: ldapmodify -x -D
"cn=admin_account,dc=courtesymortgage,dc=com" -W -f <ldif_file>

> For instance, i'd also like to update the description of some things as
well.
> By chance, anyway you can show me how to do that?

The mechanism is the same:

dn: cn=DomainUsers,ou=Groups,dc=courtesymortgage,dc=com
changetype: modify
replace: description
description: New description about the directory

I think it´s relatively simple to work with .ldif files, although not very
practice eventually... ;-)

> Lastly, where can I go to find out more of these tricks? Im having a very

> hard time finding good documentation on these sort of things.

I think you can try with the link above. There are anothers, but at the
moment I can´t remember anyone. :-(
Best regards

Luiz

==========================================================================

At 04:51 PM 8/7/2003 -0300, you wrote:

>Hi Jason
>
> > Actually, I have not tried that. i will give that a shot.
> > So basically, if I wanted to remove the user blackberry from the group
>cm,
> > I would do the following:
> > ldapdelete -x -D "cn=admin_account,dc=courtesymortgage,dc=com" -W
> > dn: cn=cm,ou=Groups,dc=courtesymortgage,dc=com
> > changetype: modify
> > delete: memberUid
> > memberUid: blackberry
> > <CTRL>+<D>
> > And that should remove the user blackberry from the group CM, correct?
> > Thanks for your help.
>
>No, not exactly this. The correct is:
>
>1) Create a ldif file (for example, modify.ldif) with the changes. In your
>case:
>
>dn: cn=cm,ou=Groups,dc=courtesymortgage,dc=com
>changetype: modify
>delete: memberUid
>memberUid: blackberry
>
>2) Run the following command:
>
>ldapmodify -x -D "cn=admin_account,dc=courtesymortgage,dc=com" -W -f
>./modify.ldif
>
>I think that are some way to make this change in the "flying mode",
without
>the ldif file (something similar to the procedures that I was send to you
>before), but I don´t know how. With the ldif file it works (I tested here
>:-) ).
>
>Best regards.
>
> >Hello
> >
> >Had you tried something like this?
> >
> >ldapdelete -x -D "cn=admin_account,dc=courtesymortgage,dc=com" -W
> >dn: cn=cm,ou=Groups,dc=courtesymortgage,dc=com
> >changetype: modify
> >delete: memberUid
> >memberUid: jwilliams
> ><CTRL>+<D>
> >
> >Best regards
> >
> >
> >
> >
> >
> >                       Jason
> > Williams
> >
> >                       <jwilliams@courtesymortga        To:
> > openldap-software@OpenLDAP.org
> >                       ge.com>                          cc:
> >
> >                       Sent by:                         Subject:
removing
>
> > a field from ldap entry
> >                       owner-openldap-software@O
> >
> >                       penLDAP.org
> >
> >
> >
> >
> >
> >                       07/08/2003
> > 15:27
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >hello everyone...
> >I have the following entry in my test system:
> >
> >
> ># blackberry, Users, courtesymortgage, com
> >dn: uid=blackberry,ou=Users,dc=courtesymortgage,dc=com
> >cn: blackberry
> >sn: blackberry
> >uid: blackberry
> >uidNumber: 1003
> >gidNumber: 1000
> >homeDirectory: /home/blackberry
> >loginShell: /bin/bash
> >gecos: System User
> >description: System User
> >objectClass: inetOrgPerson
> >objectClass: posixAccount
> >objectClass: sambaAccount
> >pwdLastSet: 0
> >logonTime: 0
> >logoffTime: 2147483647
> >kickoffTime: 2147483647
> >pwdCanChange: 0
> >pwdMustChange: 2147483647
> >displayName: System User
> >acctFlags: [UX]
> >rid: 3006
> >primaryGroupID: 3001
> >
> >I created this user using the idealx scripts. I made the users primary
> >group loanofficers.
> >I then added this user to a second group, cm. This is evident when I do:
> >
> >[root@PDC-SRV sbin]# groups blackberry
> >blackberry : loanofficers cm
> >
> >Below, are the entries for loanofficers and cm groups.
> >
> ># loanofficers, Groups, courtesymortgage, com
> >dn: cn=loanofficers,ou=Groups,dc=courtesymortgage,dc=com
> >objectClass: posixGroup
> >cn: loanofficers
> >gidNumber: 1000
> >
> ># cm, Groups, courtesymortgage, com
> >dn: cn=cm,ou=Groups,dc=courtesymortgage,dc=com
> >objectClass: posixGroup
> >cn: cm
> >gidNumber: 1001
> >memberUid: jwilliams
> >memberUid: blackberry
> >
> >My question is this: I want to remove this user from the 'cm' group, but
>im
> >
> >not sure how.
> >Anyone know of a good way to change this for this user? Im a little
>unclear
> >
> >on exactly how to do it so I thought i'd ask.
> >
> >Thanks.
> >
> >Jason