How to terminate all reseller's accounts but leave DNS on server?

All right, first grab a list of all the accounts and put that list into a file called /root/acctlist

grep -v 'root\|#' /etc/trueuserowners | grep resellerusername | cut -d: -f1 > /root/acctlist

Please replace resellerusername with the reseller's username. For example, here's what I get on my machine when I run this where the users are the accounts under my endar reseller:

root@host [/]# grep -v 'root\|#' /etc/trueuserowners | grep endar | cut -d: -f1 > /root/acctlist
root@host [/]# cat /root/acctlist
ratings
endar


Now that you have a list of users, you can run the following to loop through that list to terminate the accounts but still keep the DNS:

for i in `cat /root/acctlist` ;do /usr/local/cpanel/scripts/killacct $i --killdns=n --force ;done

This is a very powerful command as it will remove the accounts entirely without any prompt to ask if you want to do so due to the --force portion. Please only use this if you are absolutely positive that a) you have backups available if anything goes wrong for all accounts, b) the list of accounts in /root/acctlist is the correct list of accounts owned by that reseller.
 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to login to WebHost Manager?

In order to login to WebHost Manager (WHM), you must first have your login details including:...

What is the difference between WebHost Manager (WHM) and cPanel?

Now let's learn what the difference is between WHM & cPanel. WHM is a resellers control...

Becoming familiar with and navigating around in WHM?

Ok, let's take a look around. In this center frame there are several icons we can click on....

How to setup your remote access key in WHM?

This demo assumes you've already logged in to WebHost Manager (WHM). Now let's learn how to...

Checking your server status and information in WHM

This demo assumes you've already logged in to WebHost Manager (WHM). Let's take a look at...