Suspend all cPanel accounts at once?

Sujoy Dhar

Well-Known Member
Jul 24, 2016
65
9
8
India
cPanel Access Level
Root Administrator
Twitter
Is there any way to suspend all of the cpanel accounts or bulk account suspension as I can't see any option instead of one by one account suspension, its a kind of boring work to suspend manually for 200 cpanel accounts!
 

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,980
156
368
SLC
cPanel Access Level
DataCenter Provider
No such function at this time for cpanel
But the command below should work
Waring use at you own risk have not tested


for username in `cat /etc/userdomains | awk {'print $2'} | grep -v nobody | sort -n | uniq`;do /scripts/suspendacct $username;done
 

Bob1965

Member
Aug 30, 2018
23
3
3
Germany
cPanel Access Level
Root Administrator
Is there any way to suspend all of the cpanel accounts or bulk account suspension as I can't see any option instead of one by one account suspension, its a kind of boring work to suspend manually for 200 cpanel accounts!
You can accomplish this in WHM under:
Home » Resellers » View Reseller Usage and Manage Account Status

You select the reseller you would like to suspend and you can suspend all accounts.

Regards,
Bob
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
465
113
UK
cPanel Access Level
Root Administrator
You can accomplish this in WHM under:
Home » Resellers » View Reseller Usage and Manage Account Status

You select the reseller you would like to suspend and you can suspend all accounts.
What if you don't have any resellers ?
 

Bob1965

Member
Aug 30, 2018
23
3
3
Germany
cPanel Access Level
Root Administrator
The accounts have to be owned by someone, I guess in your case yours are owned by root?
If you wish to suspend them all at once you have to change ownership to someone else other than root. You can also create a dummy reseller, it does not have to be a real website. Otherwise you have suspend each account individually.

Regards,
Bob
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
There is no way to do this natively within WHM at this time but the suggestion by @dalem is probably the easiest way to accomplish suspending all the accounts without making changes to the users.

You might like the feature request here: Suspend/Unsuspend Multiple accounts I'd suggest voting for this and becoming a part of the conversation here if this is something you'd like to see in the future.


Thanks!
 

Sujoy Dhar

Well-Known Member
Jul 24, 2016
65
9
8
India
cPanel Access Level
Root Administrator
Twitter
Really a nice idea but cpanel would bring this feature of suspending all together as soon as possible as we can bulk terminate then there should be bulk suspension too.
The accounts have to be owned by someone, I guess in your case yours are owned by root?
If you wish to suspend them all at once you have to change ownership to someone else other than root. You can also create a dummy reseller, it does not have to be a real website. Otherwise you have suspend each account individually.

Regards,
Bob