Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Directory (http://www.linux-archive.org/fedora-directory/)
-   -   Delete users from different groups (http://www.linux-archive.org/fedora-directory/691962-delete-users-different-groups.html)

Fosiul Alam 08-08-2012 06:53 PM

Delete users from different groups
 
Hi
I need some idea how to do this .

I know how to delete a user from a group.

but problem is
I am trying to write a script which will delete user from different group..
also there is a problem
Some users in added as uniquemeber and some users has been added a mumberUid"

but dont understand .. how to processed
is there any thought ?? or advise ??


Thanks
--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

Mark Reynolds 08-08-2012 07:22 PM

Delete users from different groups
 
Fosiul,

The best practice is to first locate the groups that the user belongs to
by using a search filter like this:


ldapsearch -D "cn=directory manager" -w password -b "dc=example,dc=com"
"(|(uniquemember=uid=name,dc=example,dc=com)(membe rUid=uid=name,dc=example,dc=com))"


Of course you could easily expand this filter to include other
attributes like member:


(|(uniquemember=uid=name,dc=example,dc=com)(member Uid=uid=name,dc=example,dc=com)(member=uid=name,dc =example,dc=com))

Then you can do a ldapmodify to remove the user from the group(s):

ldapmodify -D "cn=directory manager" -w password
dn: cn=group,dc=example,dc=com
changetype: modify
delete: uniquemember
uniquemember: uid=name,dc=example,dc=com

Mark

On 08/08/2012 02:53 PM, Fosiul Alam wrote:

Hi
I need some idea how to do this .

I know how to delete a user from a group.

but problem is
I am trying to write a script which will delete user from different group..
also there is a problem
Some users in added as uniquemeber and some users has been added a mumberUid"

but dont understand .. how to processed
is there any thought ?? or advise ??


Thanks
--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users


--
Mark Reynolds
Senior Software Engineer
Red Hat, Inc
mreynolds@redhat.com

--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

Josh Ellsworth 08-08-2012 08:50 PM

Delete users from different groups
 
I'm working on a python script to automate some management tasks. I would take a look at the python-ldap package. So far it is working well. I'm doing almost exactly what Mark mentions.

-----Original Message-----
From: 389-users-bounces@lists.fedoraproject.org [mailto:389-users-bounces@lists.fedoraproject.org] On Behalf Of Mark Reynolds
Sent: Wednesday, August 08, 2012 3:23 PM
To: General discussion list for the 389 Directory server project.
Subject: Re: [389-users] Delete users from different groups

Fosiul,

The best practice is to first locate the groups that the user belongs to by using a search filter like this:

ldapsearch -D "cn=directory manager" -w password -b "dc=example,dc=com"
"(|(uniquemember=uid=name,dc=example,dc=com)(membe rUid=uid=name,dc=example,dc=com))"

Of course you could easily expand this filter to include other attributes like member:

(|(uniquemember=uid=name,dc=example,dc=com)(member Uid=uid=name,dc=example,dc=com)(member=uid=name,dc =example,dc=com))

Then you can do a ldapmodify to remove the user from the group(s):

ldapmodify -D "cn=directory manager" -w password
dn: cn=group,dc=example,dc=com
changetype: modify
delete: uniquemember
uniquemember: uid=name,dc=example,dc=com

Mark

On 08/08/2012 02:53 PM, Fosiul Alam wrote:
> Hi
> I need some idea how to do this .
>
> I know how to delete a user from a group.
>
> but problem is
> I am trying to write a script which will delete user from different group..
> also there is a problem
> Some users in added as uniquemeber and some users has been added a mumberUid"
>
> but dont understand .. how to processed is there any thought ?? or
> advise ??
>
>
> Thanks
> --
> 389 users mailing list
> 389-users@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/389-users

--
Mark Reynolds
Senior Software Engineer
Red Hat, Inc
mreynolds@redhat.com

--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users
--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users


All times are GMT. The time now is 05:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.