Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Script to automatically suspend inactive accounts

Discussion in 'Workarounds and Optimization' started by ziGuy, Jan 1, 2015.

  1. ziGuy

    ziGuy Registered

    Joined:
    Jan 1, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    /https://github.com/ziGuy/cPanel

    This script will go through all cpanel accounts and check whether
    each account is active according to dns records (a and mx), resolving from
    an external dns server.
    Please note that if an account is using an external redirection
    like cloudflare, it will be considered as inactive.
    ns records are NOT being checked.
    In the end of the scanning you can choose to automatically suspend all,
    inactive accounts, and in the next run you can choose to terminate those.
    You can also terminate only suspended accounts that have been suspended 3 month ago.

    cpInactiveAcct.png
     
    #1 ziGuy, Jan 1, 2015
    Last edited by a moderator: Jan 4, 2015
  2. MilesWeb

    MilesWeb Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2012
    Messages:
    173
    Likes Received:
    2
    Trophy Points:
    68
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thank you for the share. Cheers.

    BTW, will it check for the Addon domains as well ? At times, the main domain does not resolve to server IP whereas the Addon domain do point to server IP address.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ziGuy

    ziGuy Registered

    Joined:
    Jan 1, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    My pleasure.

    Yes it will check for all types: subdomains, addon domains and parked domains.
    If at least one of the above resolves to one of the server's IP(s), the account will be considered as active account.
     
  4. MilesWeb

    MilesWeb Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2012
    Messages:
    173
    Likes Received:
    2
    Trophy Points:
    68
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    That's a great feature. Worth giving it a try. Will post output of the plugin once I try it. Will help during the server audits.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    In addition to the custom script, you may also want to submit a feature request to have this functionality included with cPanel natively:

    Submit A Feature Request

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice