Force user change his password every 6 months
Posted: Thu Jun 19, 2025 4:14 am
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":
In the above script, just replace "YourDomainID" with the real domain ID.
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