[K12OSN] End Of Year Cleaning

Scott Sherrill scott at remc1.org
Thu Jun 15 18:30:18 UTC 2006

Huck wrote:
> I would like to just delete all the accounts in one group the STUDENT 
> group,
> is there a way of doing this?

> you can use the webmin batch to do that...
> extract the usernames
> create a file:
> deletethese.txt  that contains the following:
> delete:usernameX
> delete:usernameY
> delete:usernameZ
> etc...
> then with the webmin useradmin module..
> use that file to delete the users&homedirs.

To build on Huck's suggestion if the students are all in group 100 (for 
example) you could do something like:

cat /etc/passwd | grep ":100:" | cut -d: -f1 | awk '{print "delete:"$1}'

from the command line

which will give you output similar to:

Double check before send the list into webmin - for example because I 
chose :100: as my search criteria,  there is a system account called 
games that is has a userid of 100 and it picked it up as well.


More information about the K12OSN mailing list