Force user change his password every 6 months

You can share your Lua Scripts with everybody here.
Post Reply
FTP
Site Admin
Posts: 2171
Joined: Tue Sep 29, 2009 6:09 am

Force user change his password every 6 months

Post by FTP »

First, enable the option "Domain > Settings > General Settings > Password & Security > Need to change the password on the first logon", also enable the option "Edit user -> General -> User can change their password" for all the user accounts.

Then you can add a monthly task under "Server -> Task Scheduler -> Add Task":

Code: Select all

local month = tonumber(os.date("%m"))

if month == 6 or month == 12 then
  local domain = "YourDomainID"
  local userlist = Split(c_GetUserList(domain), "\n")
  for _,username in pairs(userlist) do
    c_ResetUserLoginIP(domain, username)
  end
end
In the above script, just replace "YourDomainID" with the real domain ID.
Post Reply