The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to mass suspend account

Discussion in 'General Discussion' started by sharmaine001, Aug 14, 2009.

  1. sharmaine001

    sharmaine001 Well-Known Member

    Joined:
    Jun 23, 2006
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Is there a way to suspend multiple accounts at one time?
     
  2. logicsupport

    logicsupport Well-Known Member

    Joined:
    Jun 5, 2007
    Messages:
    138
    Likes Received:
    0
    Trophy Points:
    16
    I don't think this functionality is currently available in the WHM . I would say you take a list of users that need to be suspended and write a simple script . Open a file named "suspend" and copy the below script .

    root@test [~]#vi suspend

    #!/bin/bash
    for i in `cat /root/accounts`;do
    /scripts/suspendacct $i;
    done

    root@test [~]#chmod 755 suspend

    Note that /root/accounts should contain the accounts username that you wish to suspend.

    root@test [~]# vi /root/accounts

    testuser1
    testuser2


    After that run the script as "root"

    root@test [~]# bash suspend

    Its a simple script .You can modify it as needed .
     
  3. gearheadhost

    gearheadhost Member

    Joined:
    Jun 14, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    This is not built into WHM but there are a few tweaks you can do to the above line.

    prevent reseller from unsuspending
    /scripts/suspendacct $i 1;

    This will show the suspended reason in WHM of "Because you are using 1kb of RAM" lol
    /scripts/suspendacct $i "Because you are using 1kb of RAM";

    or if you want some more fun change it to /scripts/killacct $i;

    Happy bashing!
     
Loading...

Share This Page