Deletion of list of user based on a text file In LDAP UNIX server
Dear All,
It would be really nice, if you could help me to write a script for deletion of list of user( more than 15000 users) stored in a file and sorted by email address( i need deletion of only a particular type of mail address).
Is the any script to write and take the file as input and delete the user from our LDAP data base( LDAP data base is based on Linux Server).
I used to search user through:
We can delete ldapdele or ldapmodify for deletion, it script is based on this command it would be nice.
Please reply me soon, waiting for your valuable reply.
Please use code tags in future when posting commands, logs, data etc. I have changed this in your post already.
You might want to use a loop like a while/read around the command ldapdelete and feed it with that list.
Though to be better safe than sorry you will have a small list of users to delete (let's say 3 of them), instead of all 15.000.
Thanks for you replay. I guess, my concern is not still resolved.
Let me explain you a bit details, so that you get some idea to help me better.
I have searched the user for particular email address based, then used below command.
it is giving me the list of user which are supposed to delete from O=AN AG,C=EE, example
15000 entires....
And this also as DN: EMAIL=abc.123@dxy.com,O=AN AG,C=EE
Please advice me based on looping only script to delete the user from linux servers whole 15000 user without distubing other users in LDAP.
I think it still will work like what I posted before. If you did not understand what I wrote or what particular is not matching your request, say so please.
You will have to write the mini script yourself.
Also I asked you to use code tags, which you still don't do so you can use the automatic PM with instructions how and when to use code tags.
If you have a list of users with their dn, then try to use it in the way I have shown already. As also said already, start with maybe 3 users, to not kill any other user account.
Hi everyone,
I am not that familiar with LDAP advanced contents. But since it is a popular secure tool for authentication, I preferred to user RedHat LDAP. The organization has 5 organizational units. There are 3 client servers and I want to limit each client to access different users.
So, I... (3 Replies)
I have a text file with a list of items/patterns:
ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig12238
ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig34624... (1 Reply)
Folks,
I have written one script for following condition by referring some of online post in this forum. Please correct it if I'm missing something in it. (OS: AIX 5.3)
List the idle user. (I used whoidle command to list first 15 user and get username, idle time, pid and login time).... (4 Replies)
Hi All,
I am fairly new to the world of Unix, and I am looking for a way to replace a line of text in a file with a delimited array of values.
I have an aliases file that is currently in use on our mail server that we are migrating off of. Until the migration is complete, the server must stay... (8 Replies)
Good morning,
Firstly my appologies if this post is not exactly approprate for this forum but I do not know were else to post it. If anyone knows of a better forum for this please let me know.
I need to script an ldapsearch that will interrogate both unix and windows ldap servers. When it... (1 Reply)
Hi all
I currently use the following in shell.
#!/bin/sh
while read LINE
do
perl -i -ne "$/ = ''; print if !m'Using archive: ${LINE}'ms;" "datafile"
done < "listfile"
NOTE the single quote delimiters in the expression. It's highly likely the 'LINE' may very well have characters in it... (3 Replies)
Hi Everyone,
Please help me with this. I have gone through many posts here but couldn't find what I wanted.
I have a file with 79000+ lines and I want to delete lines in a pattern.
I want to delete every 141st line in the file, starting from line 2000 till 50000.
Please help guys.
... (8 Replies)
Hi,
I have a mail server with limited space and operating system is sun solaris 8 (sparc). I do not have provisions to increase the space for home directory.
So i have to delete files from /home/username/mail/trash which are more than 10 days old automatically.
So my script should be like... (1 Reply)
Hi,
In a shell script I am makin use of 3 files f1,f2 and f3.txt.
When the Unix server is restarted I want to delete all these 3
files if they are existing.
( I suppose I will have to use this command
rm /thefilepath/f*
but dont know in which script to use.)
Anyone knows what can be... (6 Replies)