Hi!
I need to know if exist any way to suspend multiple accounts from WHM?
If not, how can I suggest the idea to the CPanel development team?
Thanks!
Hi!
I need to know if exist any way to suspend multiple accounts from WHM?
If not, how can I suggest the idea to the CPanel development team?
Thanks!
This functionality is not currently available in the WHM interface. There is already a feature request for this functionality in our official feature request system that you can vote on:
http://bugzilla.cpanel.net/show_bug.cgi?id=2564
You should be able to do this via SSH, however I can't say that I've ever tried.
Take your list of users that need to be suspended.
Yo can write a little shell script i.e.
pico test1.sh
add the following lines:
/scripts/suspendacct user1
/scripts/suspendacct user2
.
.
.
.
.
Then save and change file permission to 755 run the file.
**NOTE: Replace "user1, user2, etc" with the actual usernames.
Put the text into a text file like resellersuspend.pl , then chmod u+x resellersuspend.pl , then run with the reseller cpanel username and -what, -go or -unsuspend. -what is to see what accounts it is to suspend without doing anything, just to check the script is going to do the right thing before pulling the trigger...
#!/usr/local/bin/perl
@ARGV == 2 || die "usage: $0 reseller (-what|-go|-unsuspend)\n";
$reseller = shift(@ARGV);
$what = shift(@ARGV);
$infile = '/etc/trueuserowners';
open(INF,"<$infile") || die "cannot open $infile\n";
@lines = <INF>;
close(INF);
@lines = grep(/\:\s$reseller$/,@lines);
chomp(@lines);
foreach $line (@lines){
($acct,$reseller) = split(/\:/,$line);
print "/scripts/suspendacct $acct\n";
if($what eq "-go"){
system("/scripts/suspendacct $acct");
}
elsif($what eq "-unsuspend"){
system("/scripts/unsuspendacct $acct");
}
}